예제 #1
0
    AIMoveScript AIInformation; //Mainly consists of

    // Use this for initialization
    void Start()
    {
        //Obtain skills from children
        skills = GetComponentsInChildren <Skill>();

        //Obtain components from parent
        animator      = GetComponentInParent <Animator>();
        AIInformation = GetComponentInParent <AIMoveScript>();

        //Set cooldowns
        currentCooldowns = new float[skills.Length];
        for (int i = 0; i < skills.Length; i++)
        {
            currentCooldowns[i] = 0;
        }
    }
예제 #2
0
    public override void OnEnter(AIController ai)
    {
        Pawn targetPawn = ai.localBlackboard.GetProperty <Pawn>("target");

        if (targetPawn && ai.aiPawn.moveScript)
        {
            target   = targetPawn.transform;
            movement = ai.aiPawn.moveScript;

            _currentPhase = StatePhase.ACTIVE;
        }
        else
        {
            _currentPhase = StatePhase.EXITING;
        }
    }
예제 #3
0
    public override void OnEnter(AIController ai)
    {
        target = ai.localBlackboard.GetProperty <Pawn>("target");
        if (target && ai.aiPawn.equippedWeapon is MeleeWeapon && ai.aiPawn.moveScript)
        {
            weapon = ai.aiPawn.equippedWeapon as MeleeWeapon;

            movement = ai.aiPawn.moveScript;

            _currentPhase = StatePhase.ACTIVE;
        }
        else
        {
            //No target? Can't really attack nothing. Also if no way to move, you can't really get in range to melee
            _currentPhase = StatePhase.EXITING;
        }
    }
예제 #4
0
 public override void OnEnter(AIController ai)
 {
     if (ai.aiPawn.moveScript)
     {
         movement = ai.aiPawn.moveScript;
         //movement.pathToDestination = new List<Vector3>(AI.Util.CalculatePath(ai.transform, AI.Util.GetRandomNearbyPoint(ai.transform.position, 15)));
         //movement.DoMovement = true;
         howLongToWait             = Random.Range(5.0f, 10.0f);
         movement.OnPathComplete  += GoGetPath;
         movement.OnGiveUpPathing += GoGetPath;
         _currentPhase             = StatePhase.ACTIVE;
     }
     else
     {
         _currentPhase = StatePhase.INACTIVE;
     }
 }
예제 #5
0
 // Use this for initialization
 void Start()
 {
     mothershipMS = transform.parent.GetComponent <AIMoveScript> ();
 }
예제 #6
0
 // Use this for initialization
 void Start()
 {
     mothershipMS = transform.parent.GetComponent <AIMoveScript>();       //Get a reference to the AIMoveScript in the parent
 }
예제 #7
0
 // Use this for initialization
 void Start()
 {
     myWeaponController = GetComponent <AIWeaponController>();
     myCurrentLocation  = GetComponent <Transform>();
     aiMoveInformation  = GetComponent <AIMoveScript>();
 }