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; } }
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; } }
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; } }
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; } }
// Use this for initialization void Start() { mothershipMS = transform.parent.GetComponent <AIMoveScript> (); }
// Use this for initialization void Start() { mothershipMS = transform.parent.GetComponent <AIMoveScript>(); //Get a reference to the AIMoveScript in the parent }
// Use this for initialization void Start() { myWeaponController = GetComponent <AIWeaponController>(); myCurrentLocation = GetComponent <Transform>(); aiMoveInformation = GetComponent <AIMoveScript>(); }