private float maxDistance  = 10.0f;  // 최대 거리

    void Awake()
    {
        state    = GetComponent <GuardianState>();
        ani      = GetComponent <GuardianAnimationCtrl>();
        headCtrl = GetComponentInChildren <GuardianHeadCtrl>();
        attack   = GetComponent <GuardianAttack>();

        playerLayer = LayerMask.NameToLayer("Player");
        layerMask   = 1 << playerLayer;

        (root = Selector.Make()).
        AddChild(ActionNode.Make(CheckState)).
        AddChild(Sequence.Make().
                 AddChild(ActionNode.Make(SenseFoe)).
                 AddChild(ActionNode.Make(ChecktDistFoe)).
                 AddChild(ActionNode.Make(AttackFoe)).
                 AddChild(ActionNode.Make(CheckFoeDead))
                 );
    }
Exemple #2
0
 // Use this for initialization
 void Start()
 {
     state  = GetComponentInParent <GuardianState>();
     attack = GetComponentInParent <GuardianAttack>();
 }