Пример #1
0
 public void DestroyOfTime(float t, Action ev = null)
 {
     if (ev is null)
     {
         ATimer.Set(GetInstanceID().ToString(), t, this.Sleep);
     }
     else
     {
         ATimer.Set(GetInstanceID().ToString(), t, () => { this.Sleep(); ev(); });
     }
 }
Пример #2
0
 private void OnTriggerStay2D(Collider2D col)
 {
     if (col.CompareTag("Player"))
     {
         if (mOverlapAble)
         {
             OnOverlap();
             mOverlapAble = false;
             ATimer.Set(GetInstanceID() + "OnOverlap", DelayT, () => { mOverlapAble = true; });
         }
     }
 }
Пример #3
0
 public bool MoveRandom()
 {
     if (!m_groundDetectionData.isGrounded)
     {
         return(false);
     }
     m_MoveData.State = MobMoveData.eState.Move;
     m_CurAniST       = eMobAniST.Walk;
     ATimer.Tick(this);
     if (!m_bYMoveCoolTime && !m_bJumpStart)
     {
         m_bYMoveCoolTime = ARandom.Get(70) ? true : ARandom.Get(50) ? Jump() : Fall();
         m_bYMoveCoolTime = true;
         ATimer.Set("JumpFall" + GetInstanceID(), m_MoveData.CoolTime, () => { m_bYMoveCoolTime = false; });
     }
     return(true);
 }
Пример #4
0
 protected override void OnAttackStart()
 {
     base.OnAttackStart();
     ATimer.Set(GetInstanceID() + "AttackEndTimer", AttackDuration, AttackStop);
 }
Пример #5
0
 public void OnIdleRandom()
 {
     ATimer.Set(this, m_MoveData.IdleT.Get, OnMoveRandom);
     m_MoveData.State = MobMoveData.eState.Idle;
 }
Пример #6
0
 public void OnMoveRandom()
 {
     ATimer.Set(this, m_MoveData.MoveT.Get, OnIdleRandom);
     m_MoveData.State = MobMoveData.eState.Move;
     m_MoveData.Dir   = ARandom.Dir;
 }