private void Awake()
    {
        mainCamera = Camera.main;
        weapon     = GetComponentInChildren <DemoWeaponScript>();

        animator  = GetComponentInChildren <Animator>();
        rigidbody = GetComponent <Rigidbody>();
    }
 public override void Construct()
 {
     timer           = new Timer(-1f);
     _constructed    = true;
     ownerTransform  = context.owner.transform;
     playerTransform = context.globalData.player.transform;
     weapon          = context.owner.GetComponentInChildren <DemoWeaponScript>();
     animator        = context.owner.animator;
 }
示例#3
0
    private void Awake()
    {
        agent      = GetComponent <NavMeshAgent>();
        mainCamera = Camera.main;
        weapon     = GetComponentInChildren <DemoWeaponScript>();
        //rotationCorutine = FaceDirection(transform.forward);

        agent.updateRotation = false;
    }
示例#4
0
    public override NodeStates Evaluate()
    {
        if (_constructed)
        {
            weapon = context.owner.GetComponentInChildren <DemoWeaponScript>();

            weapon.FireWeapon();
            NodeState = NodeStates.SUCCESS;

            return(NodeState);
        }
        else
        {
            Debug.LogError("Node not constructed!");
            return(NodeStates.FAILURE);
        }
    }