オーバーフローを避けつつサイン波を利用する

using UnityEngine;
using System.Collections;

public class gameObjectTestMove2 : MonoBehaviour {
  
   float count=0;
   float    speed=0.5f;
   
   // Use this for initialization
   void Start () {
   
   }
   
   // Update is called once per frame
   void Update () {
       count += Time.deltaTime*speed;
       count = count %25;    //オーバーフロー回避
       transform.position= new Vector3(Mathf.Sin(count),0,0);
       print(count);
   }
}

メニュー



  • 最終更新:2014-06-13 12:11:15

このWIKIを編集するにはパスワード入力が必要です

認証パスワード