示例#1
0
 private void Update()
 {
     if (this.isActiveAndEnabled)
     {
         m_fExistTime += Time.deltaTime;
         if (m_fExistTime >= m_fLifeTime)
         {
             m_fExistTime = 0;
             //BulletPool.g_uniqueInstance.BackToBulletPool(this.gameObject);
             //BP.BackToBulletPool(this.gameObject);
             m_reuse.Invoke(this.gameObject);
         }
     }
 }
示例#2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag(playerTag))
     {
         player.Damage(damage);
         Reuse?.Invoke(this);
     }
 }
示例#3
0
 private void AnimationEnd() //自訂的函式,在動畫結束時呼叫
 {
     if (m_reuse != null)
     {
         m_reuse.Invoke(this.gameObject);
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
示例#4
0
 private void Die()
 {
     gm.ScoreUp();
     player.StrengtUp(strengthUpIfDie);
     Reuse?.Invoke(this);
 }