private IEnumerator LoadRocket() { yield return(new WaitForSeconds(0.1f)); currentRocket = (PlayerRocket)prefab.GetInstance(); FollowTransform(); yield return(null); }
public void LaunchRocket(Vector2 toPoint) { if (currentRocket != null) { SoundControl.instance.Play(SoundControl.SoundClip.ROCKET_LAUNCH); currentRocket.Launch(toPoint); currentRocket = null; StartCoroutine("LoadRocket"); } }
public override GameObject GetGameObject(GameObjectCoords objectCoords) { GameObjectCoords rocketCoords = new GameObjectCoords() { XCoord = objectCoords.XCoord, YCoord = objectCoords.YCoord - 1 }; GameObject rocket = new PlayerRocket() { Shape = GameSettings.PlayerRocket, GameObjectCoords = rocketCoords, GameObjectType = GameObjectType.PlayerRocket }; return(rocket); }
public void AwakeFunc() { this.M_Rigidbody2D = GetComponent <Rigidbody2D>(); this.InjectionFire = this.transform.Find("InjectionFire").gameObject; this.M_PlayerRocket = GetComponent <PlayerRocket>(); }