private void Awake()
 {
     m_startMaximumSlowmotionTime     = m_maximumSlowmotionTime;
     m_startMaximumSlowmotionCooldown = m_maximumSlowmotionCooldown;
     m_cannonBall          = GetComponent <CannonBall>();
     m_cannonBall.OnDeath += (death) =>
     {
         StopSlowmotion();
         Destroy(this);
     };
 }
示例#2
0
 private void Start()
 {
     m_audioSource         = GetComponent <AudioSource>();
     m_cannonBall          = GetComponent <CannonBall>();
     m_cannonBall.OnDeath += (death) => PlayDeathSound(death);
     m_cannonBall.OnWin   += () => PlayWinSound();
     FindObjectOfType <Cannon>().OnShoot += () => PlayCannonShootSound();
     m_cannonBall.OnExperienceAdded      += (exp) => m_audioSource.PlayOneShot(m_experienceGainSound);
     m_cannonBall.Wallet.OnMoneyAdded    += (mon) => m_audioSource.PlayOneShot(m_moneyGainSound);
     m_playMusicCoroutine = StartCoroutine(PlayMusic(m_shopMusicClips));
 }
示例#3
0
 protected virtual void Start()
 {
     m_cannonBall = FindObjectOfType <CannonBall>();
     m_cannonBall.OnAcceleration        += (accelerator) => { StopCoroutine(m_rotationCoroutine); };
     m_cannonBall.OnAccelerationStopped += () => { m_rotationCoroutine = StartCoroutine(rotateObjects()); };
     LevelGenerator.GetLevelGenerator().OnGenerate += () =>
     {
         m_generatedObjects = LevelGenerator.GetLevelGenerator().GetGeneratedObjectsWithName(m_objectName);
         if (m_generatedObjects.Count == 0)
         {
             Destroy(this);
         }
         m_rotationCoroutine = StartCoroutine(rotateObjects());
     };
 }
示例#4
0
 protected override void Awake()
 {
     base.Awake();
     m_player       = GetComponent <CannonBall>();
     m_playerWallet = GetComponent <Wallet>();
 }
 private void Start()
 {
     m_button     = GetComponent <Button>();
     m_cannonBall = FindObjectOfType <CannonBall>();
     m_button.onClick.AddListener(tryForceCannonBallToJump);
 }
示例#6
0
 private void Awake()
 {
     s_instance = this;
     m_player   = FindObjectOfType <CannonBall>();
 }
 protected virtual void Awake() => m_player = FindObjectOfType <CannonBall>();
 protected virtual void Awake()
 {
     m_cannonBall = FindObjectOfType <CannonBall>();
 }