void Spawn() { GameObject go = Instantiate(spawnObject, spawnPosition.transform.position, Quaternion.Euler(0f, 0f, 0f)); WayController wc = go.GetComponent <WayController> (); wc.speed = -this.speed_wall; }
public void Init() { playerController = Instantiate(player).GetComponent <PlayerController>(); waycontroller = Instantiate(way).GetComponent <WayController>(); cameraController = Instantiate(camera).GetComponent <CameraController>(); playerController.Init(this); cameraController.Init(playerController.transform); }