コード例 #1
0
    private void Awake()
    {
        state = GetComponent <GuardianState>();
        ani   = GetComponent <GuardianAnimationCtrl>();
        eyeTr = GetComponentInChildren <MuzzleComponents>().GetComponent <Transform>();

        chargeTime = 3.0f;
        wsCharge   = new WaitForSeconds(chargeTime);
    }
コード例 #2
0
 void Start()
 {
     previousHp = hp.curHealth;
     if (playerController == null)
     {
         playerController = (Controller)GameObject.FindGameObjectWithTag("Player").GetComponent <Controller> ();
     }
     UpdateFacing();
     _state = new IdleState(this, 2f, -1);
 }
コード例 #3
0
    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))
                 );
    }
コード例 #4
0
 private void Awake()
 {
     ani    = GetComponent <GuardianAnimationCtrl>();
     state  = GetComponent <GuardianState>();
     uiCtrl = GetComponent <EnemyUICtrl>();
 }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     state  = GetComponentInParent <GuardianState>();
     attack = GetComponentInParent <GuardianAttack>();
 }