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(); }); } }
private void OnTriggerStay2D(Collider2D col) { if (col.CompareTag("Player")) { if (mOverlapAble) { OnOverlap(); mOverlapAble = false; ATimer.Set(GetInstanceID() + "OnOverlap", DelayT, () => { mOverlapAble = true; }); } } }
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); }
protected override void OnAttackStart() { base.OnAttackStart(); ATimer.Set(GetInstanceID() + "AttackEndTimer", AttackDuration, AttackStop); }
public void OnIdleRandom() { ATimer.Set(this, m_MoveData.IdleT.Get, OnMoveRandom); m_MoveData.State = MobMoveData.eState.Idle; }
public void OnMoveRandom() { ATimer.Set(this, m_MoveData.MoveT.Get, OnIdleRandom); m_MoveData.State = MobMoveData.eState.Move; m_MoveData.Dir = ARandom.Dir; }