//移動するスピードと方法を変更する public void MoveUpdate(TurnPoint turnpoint) { int new_direction = (int)turnpoint.direction; switch (new_direction) { case 0: x = 0.0f; y = speed_y; break; case 1: x = speed_x; y = 0.0f; break; case 2: x = 0.0f; y = -speed_y; break; case 3: x = -speed_x; y = 0.0f; break; } direction = new_direction; }
//関数///////////////////////////////////////////////////////////////////// void Awake() { //シングルトン参照 if (obj != this) { obj = this; } }
private void Start() { turnpoint = GetComponent <TurnPoint>(); }
//関数///////////////////////////////////////////////////////////////////// void Awake() { //シングルトン参照 if(obj != this) obj = this; }