Esempio n. 1
0
 /// <summary>
 /// 執行檢查,計算經過時間並檢查是否觸發效果或結束狀態
 /// </summary>
 public void ExecuteCheck()
 {
     if (RemainTime > 0)
     {
         //如果此狀態是觸發效果才執行觸發判斷
         if (IsTriggerBuffer)
         {
             RemainTriggerTime -= TimeUnit;
             if (RemainTriggerTime <= 0)//剩餘觸發時間小於等於0則觸發
             {
                 Trigger();
             }
         }
         RemainTime -= TimeUnit;
     }
     else
     {
         Destroy(gameObject);
         Self.RemoveBuffer(RelyBuffer.ID);
         Debug.LogWarning(string.Format("{0}的BufferID{1}被移除", Self.Name, RelyBuffer.ID));
     }
 }