void Awake() { _player = GetComponent<Player> (); _aiPlayer = GetComponent<AIPlayer> (); _aiMovement = GetComponent<AIMovement> (); _movement = GetComponent<PlatformerMovement> (); }
// Start is called before the first frame update void Start() { menu = GameObject.Find("UI_Shop"); shopSystem = menu.GetComponent <ShopSystem>(); anim = GetComponent <Animator>(); AIMove = GetComponent <AIMovement>(); }
protected void Start() { rigidbody = GetComponent <Rigidbody>(); movement = GetComponent <AIMovement>(); movement.Register(AIMovementPriority.FollowingMovement, this); }
private void Start() { aimScript = GetComponent <AIMovement>(); destinationPoint[0] = GetComponent <Transform>(); randomPoint = Random.Range(0, destinationPoint.Length); stallTime = initialStallTime; }
void Start() { anim = GetComponent <Animator> (); move = GetComponent <AIMovement> (); fireTime = Time.time; arrowPower.value = 0; }
void Start() { ai = GetComponent <AIMovement>(); anim = GetComponent <Animator>(); BaseSpeed = ai.speed; }
public override Type Tick() { if (movement.currentTarget) { return(typeof(AttackState)); } if (movement.ReachedDestination()) { if (walking) { walking = false; nextWalk = Time.time + waitTime.GenerateRandom(); } else if (nextWalk < Time.time) { walking = true; movement.useSpeed = 0.6f; movement.agent.SetDestination( AIMovement.RandomNavSphere( movement.transform.position, walkRange.GenerateRandom(), -1)); } } return(GetType()); }
private IEnumerator RotateAI(Direction newFacingDirection) { if (newFacingDirection != facingDirection) { switch (newFacingDirection) { case Direction.Front: yield return(StartCoroutine(AIMovement.Rotate(this.transform, 0, new Vector3(0, 1, 0), 0.3f))); break; case Direction.Left: yield return(StartCoroutine(AIMovement.Rotate(this.transform, -90, new Vector3(0, 1, 0), 0.3f))); break; case Direction.Right: yield return(StartCoroutine(AIMovement.Rotate(this.transform, 90, new Vector3(0, 1, 0), 0.3f))); break; case Direction.Back: yield return(StartCoroutine(AIMovement.Rotate(this.transform, 180, new Vector3(0, 1, 0), 0.3f))); break; } this.facingDirection = newFacingDirection; } }
public override void Update(GameTime gametime) { walkingAnimationTimer += (float)gametime.ElapsedGameTime.TotalMilliseconds; hitAnimationTimer += (float)gametime.ElapsedGameTime.TotalMilliseconds; if (alive) { this.sourceRectangle = new Rectangle(WIDTH * WalkingFrame, 0, WIDTH, HEIGHT); this.hitSourceRectangle = new Rectangle(WIDTH * HitFrame, 80, WIDTH, HEIGHT); if (Vector2.Distance(this.Position, targetPosition) <= 50) { this.velocity = Vector2.Zero; this.Position = new Vector2(0, 0); } else { this.velocity = AIMovement.MoveTowards(this.Position, targetPosition) * SPEED * (float)gametime.ElapsedGameTime.TotalMilliseconds; UpdateRotation(); WalkingAnimation(ref walkingAnimationTimer); HitAmimation(ref hitAnimationTimer); } if (this.health <= 0) { Alive = false; } this.Position += velocity; this.bloodPosition = position; //HIT POINT FLASH DISPLAY this.damagePosition = new Vector2(this.BoundingBox.X + randomDamageOffset, this.BoundingBox.Y + damageDisplayIncretment); if (displayingDamagePoints) { damageDisplayIncretment -= 2f; if (damageDisplayIncretment < -100f) { displayingDamagePoints = false; damageDisplayIncretment = 0f; } } // HIT POINT FLASH DISPLAY ZombieGroan(gametime); } else if (!alive) { DeathAnmationTimer -= (float)gametime.ElapsedGameTime.TotalMilliseconds; if (DeathAnmationTimer <= 0) { DeathFrame++; DeathAnmationTimer = 50f; } if (DeathFrame >= 11) { DeathFrame = 11; } } }
public FrogMoveState(GameObject npc, float timeBetweenJumps) { stateID = StateID.FrogMoving; npcController = npc.GetComponent <NPCController>(); aiMovement = npc.GetComponent <AIMovement>(); this.timeBetweenJumps = timeBetweenJumps; timeBetweenJumpsLeft = 0f; }
protected void Start() { rigidbody = GetComponent <Rigidbody>(); movement = GetComponent <AIMovement>(); targetRotation = transform.rotation; movement.Register(AIMovementPriority.TrackingMovement, this); }
public void Init(Craft craft, IOwner owner = null) { this.owner = owner; this.craft = craft; movement = new AIMovement(this); movement.SetMoveTarget(craft.transform.position); abilityControl = new AIAbilityController(this); }
void Awake() { // Class m_AIHealth = GetComponent <AIHealth> (); m_Animator = GetComponent <Animator> (); m_AIMovement = GetComponent <AIMovement> (); }
private void Awake() { movement = GetComponent <AIMovement>(); nameTag = GetComponentInChildren <TMP_Text>(); obstacle = GetComponent <NavMeshObstacle>(); agent = GetComponent <NavMeshAgent>(); Name = displayName; }
private void Start() { agent = GetComponent <UnityEngine.AI.NavMeshAgent>(); locomotion = GetComponent <AIMovement>(); anim = GetComponent <Animator>(); playerAnimator = player.GetComponent <Animator>(); //movingCubeScript = movingWaypoint.GetComponent<MovingCubeScript>(); }
private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "Lumberjack") { aiScript = collision.gameObject.GetComponent <AIMovement>(); aiScript.TakeDamage(damage); } }
public AISharedContext() { AIMapHelper = new AIMapHelper(); AIMovement = new AIMovement(); AIWeapon = new AIWeapon(); AIItemDetection = new AIItemDetection(); AIInformation = new AIInformation(); }
IEnumerator StartSequenceHiders() { playerObject1.BlockMovement(); playerObject2.BlockMovement(); foreach (GameObject AI in GameObject.FindGameObjectsWithTag("NPC")) { AIMove = AI.GetComponent <AIMovement>(); AIMove.BlockMovement(); } //AIMove.BlockMovement(); hunterLookScreen.SetActive(true); yield return(new WaitForSeconds(2)); vampireAwayMessage.SetActive(true); yield return(new WaitForSeconds(4)); vampireAwayMessage.SetActive(false); hunterLocationMessage.SetActive(true); yield return(new WaitForSeconds(4)); hunterLookScreen.SetActive(false); playerObject1.DisplayRing(); yield return(new WaitForSeconds(4)); vampireLookScreen.SetActive(true); hunterAwayMessage.SetActive(true); yield return(new WaitForSeconds(4)); hunterAwayMessage.SetActive(false); vampireLocationMessage.SetActive(true); yield return(new WaitForSeconds(4)); vampireLookScreen.SetActive(false); playerObject2.DisplayRing(); yield return(new WaitForSeconds(4)); countdownScreen.SetActive(true); count3.SetActive(true); yield return(new WaitForSeconds(1)); count2.SetActive(true); count3.SetActive(false); yield return(new WaitForSeconds(1)); count1.SetActive(true); count2.SetActive(false); yield return(new WaitForSeconds(1)); countdownScreen.SetActive(false); playerObject1.AllowMovement(); playerObject2.AllowMovement(); foreach (GameObject AI in GameObject.FindGameObjectsWithTag("NPC")) { AIMove = AI.GetComponent <AIMovement>(); AIMove.AllowMovement(); } countDown.StartCounting(); }
// Use this for initialization void Start() { player.HiderTagged += HiderTagged; for (int i = 0; i < totalNumHiders; i++) { AIMovement copy = Instantiate(hider, transform.position, Quaternion.identity) as AIMovement; copy.Setup(hidingSpots, player.gameObject); } }
// Use this for initialization void Start() { aiClass = GetComponent <AIClass>(); aiFight = GetComponent <AIFight>(); aiMovement = GetComponent <AIMovement>(); aiInteract = GetComponent <AIInteract>(); CheckJob(); GameController.gameController.questControl.GenerateQuest(job, this); }
void Awake() { playerInfo = new PlayerInfo(gameObject.name, 0); aIMovement = GetComponent <AIMovement>(); characterAnimation = GetComponent <CharacterAnimation>(); characterController = GetComponent <CharacterController>(); characterCollider = GetComponent <CharacterCollider>(); aIController = GetComponent <AIController>(); }
public PatrolState(Vector3[] waypoints, GameObject npc) { this.waypoints = waypoints; waypointMax = waypoints.Length; waypointIndex = 0; destination = waypoints[waypointIndex]; aiMovement = npc.GetComponent <AIMovement>(); stateID = StateID.Patrolling; }
protected override void Start() { base.Start(); Health = 1000f; aiMovement = GetComponent <AIMovement>(); MakeFSM(); }
private void TestForMovement() { AIMovement ai = GetComponent <AIMovement>(); if (ai != null) { ai.Toggle(); } }
public void AllowMovement() { AIMovement garbageMan = GetComponentInParent <AIMovement>(); if (garbageMan) { garbageMan.AllowMovement(); } }
// Use this for initialization void Start() { notificationToken = EventAggregator.SingletionAggregator.Subscribe <MovementNotification>(this.processPosition); animator = GetComponent <Animator>(); goblinSounds = GetComponents <AudioSource>(); movement = GetComponent <AIMovement>(); deathSound = goblinSounds[0]; painSound = goblinSounds[1]; }
// Use this for initialization void Start() { AIMovement mov = GetComponent <AIMovement>(); if (mov == null) { Debugger.LogError("AIMovement not found"); InitializationError = true; } }
// Update is called once per frame void Update() { AIMovement script = gameObject.GetComponentInParent <AIMovement>(); if (script) { radius = gameObject.GetComponentInParent <AIMovement>().evadeRadius; } CreatePoints(); }
void Start() { player = GameObject.FindWithTag("Player"); if (player != null) { health = player.GetComponent <Health>(); } mov = GetComponent <AIMovement>(); }
void Start() { GridParent = GameObject.Find("Grid"); MainMovement = GetComponent <AIMovement>(); var GridSize = GridParent.GetComponent <CreateGrid>().GridSized(); Grid = new GameObject[(int)GridSize.x, (int)GridSize.y]; Grid = GridParent.GetComponent <CreateGrid>().SettingGrid(); Player = GameObject.FindGameObjectWithTag("Player"); }
private void WanderSetUp() { AIMovementDelegate = Wander; m_agent.autoBraking = false; string log = "Tank " + m_PlayerNumber + " is a Wanderer"; Debug.Log(log); }
// Use this for initialization void Start() { _player = GetComponent<Player> (); _AISystem = GameObject.FindGameObjectWithTag (Tags.GAMECONTROLLER).GetComponent<AISystemManager> (); _grid = new Grid (_AISystem.prefabGridList); _movement = gameObject.AddComponent<AIMovement> (); _combat = gameObject.AddComponent<AICombat> (); _targetLocator = gameObject.AddComponent<AITargetPrioritizer> (); _movement.SetLevelGrid (_grid); }
// Use this for initialization void Start() { zombie = GetComponent<enemy> (); movement = GetComponent<AIMovement> (); canvas.gameObject.SetActive (false); }
void OnAIMovementChange(AIMovement.MovementType oldType, AIMovement.MovementType newType) { if (newType == AIMovement.MovementType.knockBack) { anim.SetTrigger("KnockbackOn"); } else if (oldType == AIMovement.MovementType.knockBack) { anim.SetTrigger("KnockbackOff"); } }