private void Start() { GameObject[] r = GameObject.FindGameObjectsWithTag("StartingPipe"); Object_Rotate[] t = new Object_Rotate[r.Length]; for (int i = 0; i < r.Length; i++) { t[i] = r[i].GetComponent <Object_Rotate>(); } StartingPippe = t[Random.Range(0, t.Length)]; _currentPipe = StartingPippe; }
void ChangeDirection(Direction a_Direction) { _currentAttachedPipe = (_currentAttachedPipe + 1) % AttachedPipes.Length; CurrentDirection = a_Direction.OtherPipe; transform.rotation = Quaternion.Euler(0, 0, a_Direction.Rotation.z); }
public void ChangePipe(Object_Rotate a_Pipe) { _currentPipe = a_Pipe; }