public void NSwitch() { generator_now.Generate(); cube_now = generator_now.cube.GetComponent <CubeBehavior>(); if (cube_now.GetDir() == 0) { target = null; } else { target = generator_now.neighbors[cube_now.GetDir() - 1]; } }
// Use this for initialization void Start() { generator_now = StartGenerator.GetComponent <CubeGenerator> (); generator_now.SetMoving(true); cube_now = generator_now.cube.GetComponent <CubeBehavior>(); if (cube_now.GetDir() == 0) { target = null; } else { target = generator_now.neighbors[cube_now.GetDir() - 1]; } }
public void SwitchG(GameObject next_generator) { generator_now.SetMoving(false); next_generator.GetComponent <CubeGenerator> ().SetLast(generator_now.gameObject); generator_now = next_generator.GetComponent <CubeGenerator>(); generator_now.SetMoving(true); cube_now = generator_now.cube.GetComponent <CubeBehavior>(); if (cube_now.GetDir() == 0) { target = null; } else { target = generator_now.neighbors[cube_now.GetDir() - 1]; } }