Пример #1
0
    public void Init(Transform target)
    {
        this.anim          = this.GetComponent <Animator>();
        this.target        = target;
        this.dirState      = eDirState.Front;
        this.behaviorState = eBehaviorState.Move;

        this.onMoveComplete = () =>
        {
            if (this.routine != null)
            {
                StopCoroutine(this.routine);
            }
            this.routine = StartCoroutine(AttackRoutine());
        };

        this.onNotFoundTarget = () =>
        {
            if (this.routine != null)
            {
                StopCoroutine(this.routine);
            }
            this.routine = StartCoroutine(MoveRoutine());
        };

        this.routine = StartCoroutine(this.MoveRoutine());
    }
Пример #2
0
 public bool checkCurrBehaviorType(eBehaviorState eType)
 {
     bool bIsEqual = (null != m_pBehavior) && (m_pBehavior.getType() == eType);
     return bIsEqual;
 }