void Start() { GameObject stageObject = GameObject.FindGameObjectWithTag("StageSwap"); if (stageObject != null) { stageSwap = stageObject.GetComponent <StageSwapController> (); } source = this.GetComponent <AudioSource> (); }
// Use this for initialization void Start () { base.ID = (int)IDList.ID.Cannon; _stageSwap = GameObject.FindGameObjectWithTag ("StageSwap").GetComponent<StageSwapController> (); _camera = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<Camera2DFollow> (); _player = GameObject.FindGameObjectWithTag ("Player").GetComponent<PlayerUserController> (); _playerPick = GameObject.FindGameObjectWithTag ("Player").GetComponent <PlayerPickup> (); _playerAC = GameObject.FindGameObjectWithTag ("Player").transform.FindChild("Sprite").GetComponent <Animator> (); _shotStart = this.gameObject.transform.FindChild ("BarrelEnd"); _collider = this.gameObject.GetComponent<Collider2D> (); _aim = this.gameObject.transform.FindChild ("Aim").gameObject; _aim.SetActive (false); _sfxManager = GameObject.FindGameObjectWithTag ("SFXManager").GetComponent<SFXController> (); }
// Use this for initialization void Start() { _player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerUserController> (); _stageSwap = GameObject.FindGameObjectWithTag("StageSwap").GetComponent <StageSwapController> (); _cameraTrans = this.transform; _showingObjects = true; if (Targets.Length > 0) { _target = GetTargetPosition(Targets [_counter].position); } _stageSwap.LockSwap(); _player.CanMove = false; StartCoroutine(InitialWait()); }