private void PointUpdate() { //次のポイントへ切り替え nowPoint = nextPoint; nextPoint = nowPoint.NextPoint; //スピード取得 moveSpeed = nowPoint.NEXT_CAR_SPEED; }
private float moveStartDistance; //ぶつかってきたやつとこの値以上の距離がとれればOK // Use this for initialization void Start() { //初期ポイント無いなら消す if (fastPoint == null) { Destroy(gameObject); } //ポイント情報取得 nowPoint = fastPoint; nextPoint = nowPoint.NextPoint; //初期ポイントに次のポイントが指定されてなければ消す if (nowPoint == null || nextPoint == null) { Destroy(gameObject); } //初期方向計算 directionVec = nextPoint.transform.position - nowPoint.transform.position; directionVec = directionVec.normalized; //初期位置設定 transform.position = nowPoint.transform.position; //初期スピード取得 moveSpeed = nowPoint.NEXT_CAR_SPEED; //test rotTimeMax = 1.0f; nowRotTime = 0.0f; //停止時間設定 stopTime = 0.0f; //衝突したオブジェクトの入れ物初期化 collisionObject = null; moveStartDistance = 10.0f; BGMManager.Instance.PlaySELoopSpatialSum("Car_Move", this.gameObject); }