// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); aiCharacterControl = GetComponent <AICharacterControl> (); animator = GetComponent <Animator>(); //OverrideAnimatorController (); }
private void LoadPlayerGroup() { int i = 0; for (i = 0; i < GlobalGameInfo.PlayerGroupData._GroupMemberGameObjects.Count; i++) { UnityEngine.Object tmp = null; tmp = Instantiate(GlobalGameInfo.PlayerGroupData._GroupMemberGameObjects[i], new Vector3(0f, 0f, 0f), new Quaternion()); GameObject newGO = null; newGO = (GameObject)tmp; GlobalGameInfo.PlayerGroupData._GroupMemberGameObjects[i] = newGO; //set the target for any AI characters to the member in front of them in the group AICharacterControl AI = null; AI = newGO.GetComponent <AICharacterControl>(); if (AI != null && GlobalGameInfo.PlayerGroupData._GroupMemberGameObjects.Count > 0) { AI.target = GlobalGameInfo.PlayerGroupData._GroupMemberGameObjects[i - 1]; } //store the CharacterData script Components Component t = null; t = newGO.GetComponent("CharacterData"); CharacterData temp = null; temp = (CharacterData)t; GlobalGameInfo.PlayerGroupData._groupMemberCharacterData.Add(temp); } }
void Start() { aiCharacterControl = GetComponent <AICharacterControl>(); player = GameObject.FindGameObjectWithTag("Player"); startLocation = new GameObject("EnemyStart").GetComponent <Transform>(); startLocation.position = transform.position; }
void Start() { alarms = GameObject.FindObjectOfType <Alarms>().GetComponent <Alarms>(); firemanInventory = GetComponent <Inventory>(); aiCharacterControl = GetComponent <AICharacterControl>(); CheckExtinguisher(); }
void Start() { aiCharacterController = GetComponent <AICharacterControl> (); SetPlayers(); InvokeRepeating("CmdSetTarget", 1, 0.2f); }
private void Awake() { if (characterControl == null) { characterControl = GetComponentInChildren <AICharacterControl>(); } }
// Use this for initialization void Start() { player = GameObject.Find("Player"); controller = GetComponent <AICharacterControl>(); controller.target = SelectDestination(); currentWp = controller.target; }
public void togglePause() { HeroMain.togglePause(); AICharacterControl.togglePause(); AIBossCharacterControl.togglePause(); ThirdPersonUserControl.togglePause(); }
void Start() { thirdPersonCharacter = GetComponent <ThirdPersonCharacter>(); aICharacterControl = GetComponent <AICharacterControl>(); player = GameObject.FindGameObjectWithTag("Player"); startingLocation = transform.position; }
// Use this for initialization void Start() { aiCharacter = GetComponent <AICharacterControl>(); anim = GetComponent <Animator>(); player = GameObject.FindGameObjectWithTag("Player"); currentHP = maxHP; }
public float moanRate = 3f; //Moan once every 3 seconds void Start() { aICharacterControl = GetComponent <AICharacterControl>(); audioSource = GetComponent <AudioSource>(); player = aICharacterControl.playerCharacter; sceneLoader = FindObjectOfType <SceneLoader>(); }
void Start() { _player = GameObject.FindGameObjectWithTag("Player"); _agent = GetComponent <NavMeshAgent>(); _aiCharacterControl = GetComponent <AICharacterControl>(); _agent.autoBraking = false; }
void Start() { waypointController = GetComponent <WaypointController>(); zombieAnimator = GetComponent <Animator>(); sensor = GetComponent <EnemySensor>(); characterControl = GetComponent <AICharacterControl>(); attackRangeChecker = GetComponent <AttackRangeChecker>(); thirdPersonCharacter = GetComponent <ThirdPersonCharacter>(); attackRangeChecker.enabled = false; //Add in animation events AnimationClip[] animationClips = zombieAnimator.runtimeAnimatorController.animationClips; foreach (AnimationClip clip in animationClips) { //We want to add a function to be called when the zombie attack is a place if (clip.name == "Zombie Attack") { AnimationEvent animationEvent = new AnimationEvent(); animationEvent.functionName = "AttackAnimationComplete"; //Animation time for a place where this could hit animationEvent.time = 1.13f; clip.AddEvent(animationEvent); } if (clip.name == "Zombie Death") { AnimationEvent animationEvent = new AnimationEvent(); animationEvent.functionName = "DeathAnimationComplete"; animationEvent.time = clip.length; clip.AddEvent(animationEvent); } } }
public override void TalkTo(AICharacterControl context) { if (!context.IsDead) context.IsScared = false; context.moveState = MoveState.Follow; context.SetState(new AICharacterStateFollow()); }
void Start() { playerComp = FindObjectOfType <Player> (); playerComp.notifyOnLevelingUpObservers += PlayerLeveledUp; if (enemyLevel > 1) { for (int i = 0; i < enemyLevel - 1; i++) { float tempHealth = (maxHealthPoints *= 1.22f); maxHealthPoints = tempHealth - ((tempHealth / 700f) * 25f); } } if (enemyLevel > 1) { for (int i = 0; i < enemyLevel - 1; i++) { damagePerShot *= 1.21f; } } currentHealthPoints = maxHealthPoints; thisBasePoint = Instantiate(basePoint, transform.position, transform.rotation, transform.parent); initialMoveRadius = moveRadius; player = GameObject.FindGameObjectWithTag("Player"); aiCharControl = GetComponent <AICharacterControl> (); }
private void Awake() { navMesh = GetComponent <NavMeshAgent>(); aICharacterControl = GetComponent <AICharacterControl>(); estados = GetComponent <ControladorIA.Estados>(); projectil = GetComponent <ProjectilScript>(); }
public override void Scare(AICharacterControl context) { context.SetState(new AICharacterStateStand()); context.IsScared = true; context.playerController.Tell("Kelly", "Oh...I'm so scared"); context.moveState = MoveState.Stand; }
void Start() { healthBar = GetComponentInChildren <EnemyHealthBar>(); currentHealth = maxHealthPoints; aiCharacterControl = GetComponent <AICharacterControl>(); player = GameObject.FindGameObjectWithTag("Player"); }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody>(); agent = GetComponent <NavMeshAgent>(); characterController = GetComponent <AICharacterControl>(); inLightCone = false; lastknownPosition = new GameObject(); wanderTarget = new GameObject(); if (patrolPoints.Length == 0) { patrolPoints = GameObject.FindGameObjectsWithTag("Patrol Point"); IComparer myComparer = new patrolPointSorter(); Array.Sort(patrolPoints, myComparer); } if (startingPatrolIndex >= patrolPoints.Length) { startingPatrolIndex = 0; } patrolIndex = startingPatrolIndex; GetNextDestination(); stoppingDistance = agent.radius * 1.3f; isStunned = false; timer = attackTiming; }
// -- Game loops void Start() { _aiController = GetComponent <AICharacterControl>(); _moveTarget = new GameObject("Player Move Target"); _meleeAttackController = GetComponent <MeleeWeaponAttack>(); Camera.main.GetComponent <CameraRaycaster>()._notifyMouseClicked += ProcessMouseClick; }
//START void Start() { //FETCH CONTROLLERS worldController = FindObjectOfType <WorldController>(); aiCharacter = GetComponent <AICharacterControl>(); //OPINIONS if (likedActivities == null) { likedActivities = new List <string>(); } if (dislikedActivities == null) { dislikedActivities = new List <string>(); } //DIALOGUES if (likedDialogues == null) { likedDialogues = new Dictionary <string, string>(); } if (dislikedDialogues == null) { dislikedDialogues = new Dictionary <string, string>(); } if (likedActivities.Count == 0 && dislikedActivities.Count == 0) { DecideOpinions(); } }
// Start is called before the first frame update void Start() { aiControl = GetComponent <AICharacterControl>(); if (aiControl.target == null) { UpdateTarget(); } }
void Start() { //rb = GetComponent<Rigidbody2D>(); player = GameObject.FindGameObjectWithTag("Player"); gameController = (GameController)GameObject.FindGameObjectWithTag("GameController").GetComponent(typeof(GameController)); aiControl = (AICharacterControl)gameObject.GetComponent(typeof(AICharacterControl)); aiControl.SetTarget(player.transform); }
// Use this for initialization void Start() { target = GetComponent <AICharacterControl>(); CapsuleCollider collider = GetComponent <CapsuleCollider>(); collider.height = GetComponent <NavMeshAgent>().height; collider.center = new Vector3(0, collider.height / 2f, 0); }
// Use this for initialization void Start() { agent = GetComponent <UnityEngine.AI.NavMeshAgent>(); aiCharacter = GetComponent <AICharacterControl>(); player = GameObject.FindGameObjectWithTag("Player"); agent.updateRotation = false; agent.updatePosition = true; }
void Start() { Health = HealthMax; ThePlayer = GameObject.FindGameObjectWithTag("Player"); ThePlayerScript = ThePlayer.GetComponent <Player>(); AIControl = GetComponent <AICharacterControl>(); HealTimer = new Timer(HealCooldown); }
public override void Act(GameObject player, GameObject npc) { AICharacterControl ai = npc.GetComponent <AICharacterControl>(); ThirdPersonCharacter character = npc.GetComponent <ThirdPersonCharacter>(); ai.agent.SetDestination(player.transform.position); character.Move(ai.agent.desiredVelocity, false, false); }
private void MoveToDestination(Vector3 _destination) { AICharacterControl AIController = GetComponent <AICharacterControl>(); AIController.SetTarget(_destination); //m_navMeshAgent.SetDestination(_destination); }
void Start() { cameraRaycaster = Camera.main.GetComponent <CameraRaycaster>(); thirdPersonCharacter = GetComponent <ThirdPersonCharacter>(); aiCharacterControl = GetComponent <AICharacterControl>(); walkTarget = new GameObject("walkTarget"); cameraRaycaster.notifyMouseClickObservers += OnMouseClick; // adding to the set of observers of CameraRaycast }
IEnumerator MoveBuyerOnce(AICharacterControl buyerAI, float delayTime) { yield return(new WaitForSeconds(delayTime)); buyerAI.agent.stoppingDistance = 0.1f; buyerAI.agent.speed = 0.2f; buyerAI.StepForward(1f); }
private void Start() { player = GameObject.FindGameObjectWithTag("Player"); aiCharacterControl = GetComponent <AICharacterControl>(); nmAgent = GetComponent <NavMeshAgent>(); nmAgent.stoppingDistance = attackRadius; currentHealthPoints = maxHealthPoints; }
private void Start() { cameraRaycaster = Camera.main.GetComponent <CameraRaycaster>(); m_Character = GetComponent <ThirdPersonCharacter>(); currentClickTarget = transform.position; aICharacterControl = GetComponent <AICharacterControl>(); walkTarget = new GameObject("walkTarget"); }
void Awake() { if(_animator == null) _animator = GetComponent<Animator>(); _aiController = GetComponent<AICharacterControl>(); _thirdPersonController = GetComponent<ThirdPersonCharacter>(); _characterController = GetComponent<CharacterController>(); }
public virtual void Kill(AICharacterControl context) { context.IsDead = true; context.SetState(new AICharacterStateDead()); context.playerController.Tell("Kelly", "I'm...sorry...I...failed..."); context.Skeleton.SetActive(true); context.Body.SetActive(false); context.moveState = MoveState.Stand; }
void Start() { // state = State.LEAVE; // GameObject god = GameObject.Find("God"); // God godScript = god.GetComponent<God>(); // God.startRitual += new EventHandler(Pray); state = State.WANDER; outerPoint = GameObject.Find("OuterPoint"); map = GameObject.Find("map"); mapCollider = map.GetComponent<Collider>(); navMeshAgent = GetComponent<NavMeshAgent>(); character = GetComponent<ThirdPersonCharacter>(); characterControl = GetComponent<AICharacterControl>(); StartCoroutine(GetTargetLoop(UnityEngine.Random.Range(1f, 2f) * 2f)); StartCoroutine(IAStateMachine()); }
// Use this for initialization void Start() { vision = GetComponent<VisionControl>(); nav = GetComponent<AICharacterControl>(); ani = GetComponent<Animator>(); waypointIndex = 0; isLooking = false; currentWaypoint = Waypoints[waypointIndex]; state = "Patrol"; nav.target = currentWaypoint; pm = GameObject.FindObjectOfType<PlayerManager>().GetComponent<PlayerManager>(); }
void FixedUpdate() { if (currentPlayer == null || currentPlayer.isPlaying == false) { foreach (AICharacterControl player in aiCharacters) { if (player.currentCooldown == 0) { currentPlayer = player; player.beginTurn(); return; } } foreach (AICharacterControl player in aiCharacters) { player.currentCooldown--; } } }
/*void switchToPlayer(inputToEnable, inputToDisable, cameraLocation) { inputToEnable.enabled = true; inputToDisable.enabled = false; defaultCamera.transform.position = cameraLocation.transform.position; defaultCamera.transform.rotation = cameraLocation.transform.rotation;}*/ // Use this for initialization void Start() { ragsUserControl = GameManager.god.ragsObject.GetComponent<ThirdPersonUserControl>(); ragsAIControl = GameManager.god.ragsObject.GetComponent<AICharacterControl>(); reasonUserControl = GameManager.god.reasonObject.GetComponent<BallUserControl>(); reasonToRags = GameManager.god.reasonObject.GetComponent<FollowRags>(); ragsPlayerCam = GameManager.god.ragsCam; reasonPlayerCam = GameManager.god.reasonCam; //ragsUserControl.enabled = playerRagsActive; //reasonUserControl.enabled = playerReasonActive; //ragsPlayerCam.enabled = playerRagsActive; //reasonPlayerCam.enabled = playerReasonActive; //player1Input = player1.GetComponent("(your controller)"); //player2Input = player2.GetComponent("(your controller)"); }
private void Awake() { // Setup references. m_RigidBody = GetComponent<Rigidbody>(); m_Collider = GetComponent<Collider>(); m_AiCharacter = GetComponent<AICharacterControl>(); m_Agent = GetComponent<NavMeshAgent>(); m_Animator = GetComponent<Animator>(); // Set the position that the player will be reset to. m_OriginPosition = transform.position; }
// Use this for initialization void Start() { aiCharControl = GetComponent<AICharacterControl>(); aiCharControl.target = (wanderPoints[Random.Range(0, wanderPoints.Length)].transform.position); }
public override void TalkTo(AICharacterControl context) { //maybe add a joke answer }
public override void Abandon(AICharacterControl context) { context.SetState(new AICharacterStateDead()); context.IsDead = true; }
public virtual void TalkTo(AICharacterControl context) { }
void Start() { m_AICharacterControl = GetComponent<AICharacterControl>(); m_character = GetComponent<ThirdPersonCharacter>(); }
public virtual void Abandon(AICharacterControl context) { }
public override void Heal(AICharacterControl context) { context.SetState(new AICharacterStateFollow()); }
// Use this for initialization void Start() { characterControl = this.GetComponent<AICharacterControl> (); // where the player is playerTransform = GameObject.FindGameObjectWithTag ("Player").transform; enemyTransform = GetComponent<Transform> (); areWeFollowingPlayer = false; shootableMask = LayerMask.GetMask ("Shootable"); setInitialCheckpointAndPosition (); // to start our cop on his patrol continuePatrol(); }
public virtual void Blind(AICharacterControl context) { }
public virtual void Scare(AICharacterControl context) { }
void Start() { characterControl = GetComponent<AICharacterControl>(); }
public virtual void Heal(AICharacterControl context) { }
public virtual void Injure(AICharacterControl context) { }
public override void Injure(AICharacterControl context) { context.SetState(new AICharacterStateStand()); context.playerController.Tell("Kelly", "This...thing hit me! I'm not feeling well..."); context.IsInjured = true; }