// Use this for initialization


    // Use this for initialization
    void Start()
    {
        wapon1 = GetComponentInChildren <IInputClient>();
        GetComponent <InputClientManager>().ResetClient(wapon1);


        processor    = GetComponent <LEUnitProcessorBase>();
        animationPro = GetComponent <LEUnitAnimatorManager>();
        animationPro.SetMotionTypeImmediately(LEUnitAnimatorManager.AnimationMotionType.IWR_0);

        angent = GetComponent <NavMeshAgent>();

        partrolState = new AiPatrolState(this);
        searchState  = new AISearchState(this);
        chaseState   = new AiChaseState(this);
        fightState   = new AiFightState(this);

        partrolState.Init();
        searchState.Init();
        chaseState.Init();
        fightState.Init();

        currentState = partrolState;
        currentState.OnStateEnter();
    }
 void InitalTarget()
 {
     targetLEObject             = FindObjectOfType <TargetLE>().gameObject;
     leUnitProcessor            = targetLEObject.GetComponent <LEUnitProcessorBase>();
     leUnitAnimationManager     = targetLEObject.GetComponent <LEUnitAnimatorManager>();
     leUnitBasicMovementManager = targetLEObject.GetComponent <LEUnitBasicMoveMentManager>();
     inputActionManager         = targetLEObject.GetComponent <InputClientManager>();
 }
Ejemplo n.º 3
0
    // Use this for initialization

    private void OnEnable()
    {
        processor = GetComponent <LEUnitProcessorBase>();
        animator  = GetComponent <Animator>();
        if (animator == null)
        {
            animator = GetComponentInChildren <Animator>();
        }
        if (animator == null)
        {
            Debug.LogError("There is no Animator in this Object, or its children");
        }
    }
 bool isLEAlive(LEUnitProcessorBase le)
 {
     return(le.IsAlive());
 }