/// <summary> /// Complete Declaration for StandardMob /// </summary> /// <param name="x">X position in the world</param> /// <param name="y">Y position in the world</param> /// <param name="textureName">Name of the texture</param> /// <param name="type">AIType to use for the Mob</param> public StandardMob(float x, float y, int layer, Texture textureName, AIBase.AIType type, float width = 16, float height = 16) : base(x, y, layer, textureName, width, height) { mobAI = new AIBase(this) { type = type }; }
public StandardMob(float x, float y, Texture textureName, AIBase.AIType type = AIBase.AIType.Passive) : base(x, y, textureName) { mobAI = new AIBase(this) { type = type }; }
public void GetStart(GameObject obj) { EnemyObj = obj; //提高硬值 if (!isAcing) { isAcing = true; GetComponent <RoleDate>().addYZ(addYZNum); gameBody = GetComponent <GameBody>(); _aiBase = GetComponent <AIBase>(); if (RunName == "" || !gameBody.GetDB().animation.HasAnimation(RunName) || !gameBody.GetDB().animation.HasAnimation(AtkName)) { AcOver(); return; } oldRunName = gameBody.GetRunName(); oldRunSpeedX = gameBody.maxSpeedX; //print("---------------->AtkName " + AtkName + " RunName " + RunName+ " oldRunName "+ oldRunName); gameBody.RunACChange(RunName, moveSpeedX); if (AudioRunCut) { AudioRunCut.Play(); } } }
void Awake() { coords = new int[2]; lastCoords = new int[2]; canSee = new List<Player> (); m_AttackAxisInUse = false; tr = transform; CombatMode = false; pos = transform.position; currentPath = new List<Vector2> (); controller = GetComponent<PlayerController>(); workingAI = new AIBase (this); lastInput = Vector3.one; playerStats = new PlayerStats (); currentState = CharacterState.Still; controller.SetSpeed (playerStats.GetSpeed()); isStuck = 0; canAttack = "Enemy"; coolDownLimit = playerStats.GetAttackCooldown(); currentAttackCoolDown = 0; inventory = GetComponent<InventoryBase>(); weaponController = GetComponentInChildren<WeaponController> (); anim = GetComponent<Animator>(); spriteRen = GetComponent<SpriteRenderer> (); //seeker = GetComponent<Seeker> (); }
public void Setup(EnemyModel model) { base.Setup(); Status.Setup(model); ai_ = GetAI(model.AiId); enemy_model = model; }
public AICheckStatus(AIBase aiBase) { this.aiBase = aiBase; transform = aiBase.transform; playArea = EnemyManager.GetPlayArea(); }
public void Init() { if (isInit == true) { return; } isInit = true; thisTransform = this.transform; AIBase = thisTransform.GetComponent <AIBase>(); health = thisTransform.GetComponent <Health>(); if (abilityManager == null) { abilityManager = GameObject.FindGameObjectWithTag("AbilityManager").GetComponent <AbilityManager>(); } for (int i = 0; i < abilityNames.Length; i++) { abilityIndexes.Add(abilityManager.GetAbilityIndex(abilityNames[i])); } for (int i = 0; i < abilityIndexes.Count; i++) { InitAbility(abilityIndexes[i]); //kan ju inte bara init denna coz det är ett kinda abstrakt värde, init ska ske på denna unitspellhandlern själv } Reset(); AIBase.LoadValidSpellIndexes(); //viktigt att denne kallar, AIbase klarar ju inte av det själv :/ men den hinner inte fixa alla abilitylistor innan den vill retrieva annars }
/// <summary> /// /// </summary> /// <param name="teamId"></param> void OnAIDied(int teamId) { AIBase ai = m_AIs[teamId]; // move ai from alive buffer to leaderboard m_AliveAIs.Remove(ai); m_Leaderboard.Insert(0, ai); // deactivate ai ai.XKActive = false; XKLog.Log("Info", string.Format("An AI has died: {0} ({1}) ", ai.GetType().ToString(), ai.TeamId)); if (m_AliveAIs.Count == 1) { // store the winner m_Leaderboard.Insert(0, m_AliveAIs[0]); // deactivate gameboard, no need to keep it active XKActive = false; XKLog.Log("Info", string.Format("The last AI has died, the winner is: {0} ({1}) ", m_AliveAIs[0].GetType().ToString(), m_AliveAIs[0].TeamId)); // announce the game is over to whom ants to listen if (OnGameOver != null) { OnGameOver(m_Leaderboard); } } }
new void Start() { base.Start(); this.primaryAttack = new Attack ( this.gameObject, Attack.AttackType.MeleeAttack, 10f, // Damage 3f, // Rate of Fire 1f // Range ); maxSpeed = 12f; hspeed = .1f; this.faction = Factions.Parasite; this.gibColor = new Color32(0, 255, 0, 255); this.secondaryAttack = new Attack (this.gameObject, Attack.AttackType.ProjectileAttack, 2f, 1f, 10f ); this.AI = this.gameObject.AddComponent <AIBase>(); }
public void OnAdd(AIBase AI) { AI.Animator.SetBool("IsIdle", false); AI.Animator.SetBool("IsWalking", false); AI.Animator.SetBool("IsRunning", true); AI.NavAgent.speed = 10; }
public void Update() { AIBase followTaget = target; if (followTaget != null && followTaget.transform != null) { Transform targetTran = followTaget.transform; Vector3 eulerAngles = targetTran.eulerAngles; if (Input.GetMouseButton(1)) { angleX += Input.GetAxis("Mouse X") * mouseRotateSpeed.x * Time.deltaTime; angleY -= Input.GetAxis("Mouse Y") * mouseRotateSpeed.y * Time.deltaTime; angleY = ClampAngle(angleY, yAngleMin, yAngleMax); } Quaternion rotation = Quaternion.Euler(angleY, angleX, 0); float scrollValue = Input.GetAxis("Mouse ScrollWheel"); distance -= scrollValue; //以跟随目标为中心,向指定欧拉角方向偏移一定距离, 得出当前摄像机应该要在的坐标 Vector3 targetPos = rotation * new Vector3(0, yOffset, -distance) + targetTran.position; Camera.main.transform.position = targetPos; Camera.main.transform.rotation = rotation; } }
/// <summary> /// 添加状态 /// </summary> public void AddState(FSMState s, AIBase ctrl) { // Check for Null reference before deleting if (s == null) { Debug.LogError("FSM ERROR: Null reference is not allowed"); } s.FSM = this;//给每个状态的 FSM 赋值 s.M_CTRL = ctrl;//每个状态得到controller // First State inserted is also the Initial state, // the state the machine is in when the simulation begins if (states.Count == 0) { states.Add(s); return; } // Add the state to the List if it's not inside it foreach (FSMState state in states) { if (state.ID == s.ID) { Debug.LogError("FSM ERROR: Impossible to add state " + s.ID.ToString() + " because state has already been added"); return; } } states.Add(s); }
public TurnInfo(AIBase aibase) { turnInMotion = false; ai = aibase; gridElement = aibase.gridElement; initialLocation = gridElement.position; }
protected override void CollisionEnter(Collision other) { M_Rigidbody.Sleep(); BulletMark bulletMark = other.gameObject.GetComponent <BulletMark>(); AIBase ai = other.gameObject.GetComponentInParent <AIBase>(); // 攻击环境物体. if (bulletMark != null) { bulletMark.CreateBulletMark(hit); bulletMark.Hp -= Damage; } // 攻击AI角色. else if (ai != null) { // 头部伤害加倍. if (other.gameObject.name == "Head") { ai.Life -= 2 * Damage; ai.HitHeadState(); } else { ai.Life -= Damage; ai.HitNormalState(); } ai.PlayEffect(hit); } gameObject.SetActive(false); }
public virtual void fixedLogic() { if (popAI) { popAI = false; ai.Pop(); } if (nextAI != null) { ai.Push(nextAI); nextAI = null; } while (ai.Count > 0 && !ai.Peek().isValid()) { ai.Pop(); } if (ai.Count > 0) { AIBase newAI = ai.Peek().fixedLogicTick(); if (newAI != null) { addAIState(newAI); } } if (characterStats.getHealth() <= 0) { Destroy(gameObject); } }
public void OnAttackTarget(GameObject gameObject, float delay) { if (isHaveBomb) { if (bombPrefab != null) { target = gameObject; //Invoke("Do", delay-0.1f); //GameObject projectile = Instantiate(bombPrefab, spawnPosition.position, Quaternion.identity) as GameObject; //projectile.transform.LookAt(target.transform.position); //projectile.GetComponent<Rigidbody>().AddForce(projectile.transform.forward * 1000); GameObject projectile = Instantiate(bombPrefab, spawnPosition.position, Quaternion.identity) as GameObject; Vector3 pos = new Vector3(target.transform.position.x, Random.Range(0.0f, 2.0f), target.transform.position.z); projectile.transform.LookAt(pos); projectile.GetComponent <HyperbitProjectileScript>().isPlaying = true; projectile.GetComponent <HyperbitProjectileScript>().attackTargetType = target.gameObject.tag; } } else { AIBase aIBase = gameObject.GetComponent <AIBase>(); if (aIBase) { aIBase.OnHited(this.gameObject); } } }
public Player(int id, Color primary, int ai) { Id = id; PrimaryColor = primary; SecondaryColor = GameModel.RandomColor(new Color[] { PrimaryColor }, 300); Countries = new List <Country>(); Continents = new List <Continent>(); if (ai == 0) { AI = new AI_FullRandom(this); } else if (ai == 1) { AI = new AI_OneSafeAttack(this); } else if (ai == 2) { AI = new AI_MultipleSafeAttacks(this); } else if (ai == 3) { AI = new AI_SmartRandom(this); } else if (ai == 4) { AI = new AI_AttackWhenDense(this); } }
// Use this for initialization void Start() { if (!photonView.isMine) { Destroy(GetComponent <ThirdPersonController> ()); Destroy(GetComponent <ThirdPersonCamera> ()); Destroy(GetComponent <MouseLook> ()); GetComponent <Rigidbody> ().isKinematic = true; } else { cameraController = GetComponent <ThirdPersonCamera> (); isAi = cameraController == null; } AIBase comp = GetComponent <AIBase> (); isAi = comp != null; correctPlayerPos = transform.position; myCollider = collider; centerOffset = capsule.bounds.center - myTransform.position; headOffset = centerOffset; headOffset.y = capsule.bounds.max.y - myTransform.position.y; distToGround = capsule.height / 2 - capsule.center.y; charMan = GetComponent <CharacteristicManager> (); charMan.Init(); health = charMan.GetIntChar(CharacteristicList.MAXHEALTH); //Debug.Log (distToGround); }
public void Update(AIBase AI) { if (!AI.NavAgent.hasPath) { AI.NavAgent.SetDestination(HomePos); } }
virtual protected void DoDestroy() { aiBase = gameObject.transform.parent.GetComponentInChildren <AIBase>(); GameObject patrolObject = aiBase.GetPatrolObject(); if (aiBase != null) { Destroy(patrolObject); } SpawnManager spawnManager = GetComponentInParent <SpawnManager>(); if (spawnManager != null) { AIBase aiBase = spawnManager.GetSpanwerAI(); if (aiBase != null) { aiBase.DeductSpawn(); } } GameObject temp = Instantiate(Resources.Load("General/EnemyDestroy")) as GameObject; temp.transform.position = transform.position; spriteRenderer.color = new Color(1f, 1f, 1f, 0f); Destroy(gameObject.transform.parent.gameObject); }
private void GradualSpeedUp(AIBase r) { var targetTime = r.velocity.magnitude / GameManager.instance.globalTimeMult; StartCoroutine(Commons.DoUntil(() => r.maxSpeed /= 0.9f, () => r.maxSpeed > targetTime)); }
private void GradualSlowDown(AIBase r) { var targetTime = r.velocity.magnitude * GameManager.instance.globalTimeMult; StartCoroutine(Commons.DoUntil(() => r.maxSpeed *= 0.98f, () => r.maxSpeed < targetTime)); }
public void DeRegisterAI(AIBase ai) { if (_lumpAi.Contains(ai)) { _lumpAi.Remove(ai); } }
public RentableBot(int virtualID, Room room, AIBase ai, int ownerID, char gender, int timeLeft) : base(virtualID, ai, room) { this.OwnerID = ownerID; this.Gender = gender; this.TimeLeft = timeLeft; }
/// <summary> /// creates and initializes all base A.I. /// </summary> public override void Initialize() { base.Initialize(); // Entry patrol update function in AI AIBase aiSearch = new AIBase(); aiSearch.Updating += new EventHandler <AIBase.AIUpdateEventArgs>(OnSearchUpdateEvent); indexAiSearch = AIContext.AddAI("Search", aiSearch); // Entry move update function in AI AIBase aiMove = new AIBase(); aiMove.Updating += new EventHandler <AIBase.AIUpdateEventArgs>(OnMoveUpdateEvent); indexAiMove = AIContext.AddAI("Move", aiMove); // Entry attack update function in AI AIBase aiAttack = new AIBase(); aiAttack.Updating += new EventHandler <AIBase.AIUpdateEventArgs>(OnAttackUpdateEvent); indexAiAttack = AIContext.AddAI("Attack", aiAttack); // Entry left turn update function in AI AIBase aiTurnLeft = new AIBase(); aiTurnLeft.Updating += new EventHandler <AIBase.AIUpdateEventArgs>(OnTurnLeftUpdateEvent); indexAiTurnLeft = AIContext.AddAI("TurnLeft", aiTurnLeft); // Entry right turn update function in AI AIBase aiTurnRight = new AIBase(); aiTurnRight.Updating += new EventHandler <AIBase.AIUpdateEventArgs>(OnTurnRightUpdateEvent); indexAiTurnRight = AIContext.AddAI("TurnRight", aiTurnRight); WorldTransform = SpawnPoint; // Remove a collision if (colLayerEnemyMech != null) { if (colLayerEnemyMech.IsContain(Collide)) { colLayerEnemyMech.RemoveCollide(Collide); } } // Remove a collision if (colLayerAllMech != null) { if (colLayerAllMech.IsContain(Collide)) { colLayerAllMech.RemoveCollide(Collide); } } }
public AIMovement(AIBase aiBase) { this.aiBase = aiBase; playArea = EnemyManager.GetPlayArea(); GetRandomDirection(); }
public void changeAIState(AIBase state) { if (ai.Count > 1) { popAI = true; } addAIState(state); }
private void DeInitAI() { if (this.m_AIBase != null) { this.m_AIBase.DeInit(); this.m_AIBase = null; } }
private void Start() { attr = GetComponent <NpcAttribute>(); aiBase = GetComponent <AIBase>(); vcontroller = GetComponent <MoveController>().vcontroller; gameObject.AddComponent <DebugServerPos>(); }
public AIAndAttack(Player _player, AIBase _standardAI) : base(_player) { standardAI = _standardAI; currentAI = standardAI; currentState = AIState.Standard; maxCooldown = 2; searchCoolDown = 0.0f; target = null; }
public AnimatedSprite(string TextureName, int rows, int columns, int xIn, int yIn, AIBase ai, BaseManager manIn) { animate = new Animation(TextureName, rows, columns); AI = ai; xy = new Point(xIn, yIn); Manager = manIn; Buffs = new BuffHandler(); damageIndicator = new DamageIndicator(); }
virtual protected void Awake() { parentObject = transform.parent.gameObject; m_movementModel = gameObject.GetComponentInParent <CharacterMovementModel>(); aiBase = transform.parent.GetComponentInChildren <AIBase>(); spriteRenderer = parentObject.GetComponentInChildren <SpriteRenderer>(); speechBubble = transform.parent.GetComponentInChildren <SpeechBubble>(); maxHealth = health; }
protected override void OnAwake() { // Retrieves the desired components base.OnAwake(); _aiComponent = GetComponentInParent<AIBase>(); _independentControl = GameObject.FindGameObjectWithTag(Tags.GameController).GetComponent<GameControllerIndependentControl>(); // Registers itself to the AIBase events _aiComponent.AddListener(this); }
//public Animator anima; void Start () { states = GetComponents<AIBase> (); foreach (AIBase state in states) { state.enabled = false; } currentState = states [0]; currentState.enabled = true; // anima = GetComponentInChildren<Animator> (); // attackState = GetComponentInParent<Attack> (); // fleeState = GetComponentInParent<FleeState> (); // currentState.enabled = true; }
public void OnBeingScared(AIBase enemy, GameObject scaringObject, int scaringSize) { // Sets the eyes' color to the scared one _targetEyeColor = eyesScaredColor; // Creates the scared prefab GameObject scaredEffect = Instantiate(scaredEffectPrefab, scaredEffectTransform.position, scaredEffectTransform.rotation) as GameObject; ParticleSystem[] systems = scaredEffect.GetComponentsInChildren<ParticleSystem>(); foreach (ParticleSystem sys in systems) { sys.randomSeed = (uint)UnityEngine.Random.Range(0, int.MaxValue); sys.Simulate(0, true, true); sys.Play(); } scaredEffect.transform.parent = scaredEffectTransform; }
public override void CalculateAction() { if (currentPlayer.canSee.Count > 0 && target == null) { foreach (Player seen in currentPlayer.canSee) { if (seen.tag.Contains (currentPlayer.canAttack)) { currentState = AIState.Attack; int pickTarget = Random.Range (0, currentPlayer.canSee.Count); target = seen;//currentPlayer.canSee [pickTarget]; currentAI = new AIFollowAndAttack (currentPlayer, target); break; } } } if (target != null) { if (target.playerStats.health <= 0) { target = null; currentState = AIState.Standard; currentAI = standardAI; } if (!currentPlayer.canSee.Contains (target) && searchCoolDown < 0) { ActivateTrigger (target.lastCoords); target = null; } else if (!currentPlayer.canSee.Contains (target) && searchCoolDown >= 0) { searchCoolDown -= Time.deltaTime; } else { searchCoolDown = maxCooldown; } } BeingTriggered (); currentAI.CalculateAction (); }
void BeingTriggered() { if (isTriggered) { isTriggered = false; currentState = AIState.Search; triggerCoolDown = maxTriggerCooldown; int[] searchCoords = Utilities.Vector2ToCoords (triggered); currentAI = new AISearchArea (currentPlayer, searchCoords); Debug.Log("Is triggered"); } if (currentState == AIState.Search) { if (triggerCoolDown >= 0) { triggerCoolDown -= Time.deltaTime; }else if (triggerCoolDown < 0){ currentState = AIState.Standard; currentAI = standardAI; } } }
public void OnBeingScared(AIBase enemy, GameObject scaringObject, int scaringSize) { // Plays the scared sound _audioSource.clip = scaredSound; _audioSource.Play(); }
public void OnBeginChase(AIBase enemy, GameObject chasedObject) { // Plays the chase sound _audioSource.clip = chaseSound; _audioSource.Play(); }
public void OnBeingScared(AIBase enemy, GameObject scaringObject, int scaringSize) { foreach (EnemyBehaviourListener listener in GetComponentsInChildren<EnemyBehaviourListener>()) if (listener != this) listener.OnBeingScared(enemy, scaringObject, scaringSize); }
public void OnAttack(AIBase enemy, GameObject attackedObject, Vector3 velocity) { // Plays the hit sound if (attackedObject == gameObject) hit.PlayAudio(); }
// Use this for initialization protected void Start() { if (emitter != null) { emitter.Emit ();//запускаем эмиттер isSpawn = true;//отключаем движения и повреждения } if (!photonView.isMine) { Destroy (GetComponent<ThirdPersonController> ()); Destroy (GetComponent<ThirdPersonCamera> ()); Destroy (GetComponent<MouseLook> ()); GetComponent<Rigidbody> ().isKinematic = true; } else { cameraController=GetComponent<ThirdPersonCamera> (); isAi = cameraController==null; } mainAi = GetComponent<AIBase> (); isAi = mainAi!=null; correctPlayerPos = transform.position; myCollider = collider; centerOffset = capsule.bounds.center - myTransform.position; headOffset = centerOffset; headOffset.y = capsule.bounds.max.y - myTransform.position.y; distToGround = capsule.height/2-capsule.center.y; charMan = GetComponent<CharacteristicManager> (); charMan.Init (); health= charMan.GetIntChar(CharacteristicList.MAXHEALTH); //Debug.Log (distToGround); }
public void OnEndChase(AIBase enemy, GameObject chasedObject) { }
public void OnAttack(AIBase enemy, GameObject attackedObject, Vector3 velocity) { }
public abstract IEnumerator RunTask(AIBase _ai);
public void OnAttack(AIBase enemy, GameObject attackedObject, Vector3 velocity) { // Plays the hit effect if (attackedObject == gameObject) { Transform characterTransform = attackedObject.transform; hit.PlayEffect(characterTransform.position, characterTransform.rotation, _characterSize.GetSize()); } }
void CheckForInput() { if (workingAI != null && (publicInputVector != Vector3.zero || publicInteractVector != Vector3.zero)) { workingAI = null; } if (CombatMode) { bool successfulInteraction = AttackInDirection (publicInteractVector); publicInteractVector = Vector3.zero; } else { FilterInteractInputs(publicInteractVector); publicInteractVector = Vector3.zero; } MovePlayer (publicInputVector); publicInputVector = Vector3.zero; }
// Use this for initialization protected void Start() { aSource = GetComponent<AudioSource> (); sControl = new soundControl (aSource);//создаем обьект контроллера звука _canWallRun = canWallRun; //проигрываем звук респавна sControl.playClip (spawnSound); if (emitter != null) { emitter.Emit ();//запускаем эмиттер isSpawn = true;//отключаем движения и повреждения } if (!photonView.isMine) { Destroy (GetComponent<ThirdPersonController> ()); Destroy (GetComponent<ThirdPersonCamera> ()); Destroy (GetComponent<MouseLook> ()); GetComponent<Rigidbody> ().isKinematic = true; //ivnMan.Init (); } else { cameraController=GetComponent<ThirdPersonCamera> (); isAi = cameraController==null; } mainAi = GetComponent<AIBase> (); isAi = mainAi!=null; correctPlayerPos = transform.position; myCollider = collider; ivnMan.Init (); centerOffset = capsule.bounds.center - myTransform.position; headOffset = centerOffset; headOffset.y = capsule.bounds.max.y - myTransform.position.y; distToGround = capsule.height/2-capsule.center.y; charMan = GetComponent<CharacteristicManager> (); charMan.Init (); health= charMan.GetIntChar(CharacteristicList.MAXHEALTH); if (canJump) { jetPackCharge = charMan.GetIntChar(CharacteristicList.JETPACKCHARGE); } ivnMan.Init (); AfterSpawnAction (); //Debug.Log (distToGround); }
public void OnEndChase(AIBase enemy, GameObject chasedObject) { foreach (EnemyBehaviourListener listener in GetComponentsInChildren<EnemyBehaviourListener>()) if (listener != this) listener.OnEndChase(enemy, chasedObject); }
public sealed override IEnumerator RunTask(AIBase _ai) { yield return RunTask(_ai as AIHuman); }
public void OnBeginChase(AIBase enemy, GameObject chasedObject) { // Sets the eyes' color to the chase one _targetEyeColor = eyesChaseColor; }
public void SwitchState (AIBase newState) { currentState.enabled = false; currentState = newState; currentState.enabled = true; }
public void OnBeginChase(AIBase enemy, GameObject chasedObject) { }
public void OnBeingScared(AIBase enemy, GameObject scaringObject, int scaringSize) { // Disables the help item enabled = false; Hide(); }
public void OnAttack(AIBase enemy, GameObject attackedObject, Vector3 velocity) { // Sets the hit flag _animator.SetBool(CharacterAnimatorParameters.Hit, true); }
public void UpdateGameState() { if (CurrentState == GameState.LevelWin || CurrentState == GameState.LevelLost) { // Clear Game if (GameManager.CurrentLevel != null) { GameManager.CurrentLevel.ClearAndDestroy(); GameManager.CurrentLevel = null; } } if (CurrentState == GameState.GameStart) { ShowUIMenu(TitleMenu); OnClickGotoState = GameState.Intro; // Reset game CurrentLevelIndex = 0; RetriesUsed = 0; } else if(CurrentState == GameState.Intro) { ShowUIMenu(InfoMenu); OnClickGotoState = GameState.LoadLevel; } else if(CurrentState == GameState.LoadLevel) { LevelComboWins = 0; LevelCombosPlayed = 0; if(LoadCurrentLevel()) { ShowUIMenu(null); ChangeState(GameState.GameAI); } } else if(CurrentState == GameState.GameAI) { if (GameManager.CurrentLevel != null) { ShowUIMenu(ReadyMenu); PointRaytrace.CurrentPlayerHitsID = ""; // Create AI if null if (CurrentAI == null) { CurrentAI = AIBase.CreateAIToGameobject(GameManager.CurrentLevel.gameObject); } GameManager.CurrentLevel.DeactivateAll(); // Showing to player what to do CurrentAI.StartShowHint(); } else { Debug.LogError("Cant Play NULL Level!"); } } else if(CurrentState == GameState.GamePlayer) { ShowUIMenu(StartMenu); Invoke("HideUIMenus", 1f); LevelCombosPlayed++; // Players turn CurrentAI.Stop(); } else if (CurrentState == GameState.LevelWinOutro) { ShowUIMenu(SuccessMenu); Invoke("LevelWinOutroComplete", 2f); } else if (CurrentState == GameState.LevelWin) { ShowUIMenu(WinMenu); OnClickGotoState = GameState.LoadLevel; CurrentLevelIndex++; } else if (CurrentState == GameState.LevelLost) { RetriesUsed++; if (AcceptedRetries >= RetriesUsed) { ShowUIMenu(LostMenu); Debug.Log(RetriesUsed + " of " + AcceptedRetries + " AcceptedRetries"); OnClickGotoState = GameState.LoadLevel; BlockClickFor(0.5f); } else { ShowUIMenu(GameLoseMenu); OnClickGotoState = GameState.GameStart; BlockClickFor(0.5f); } } else if (CurrentState == GameState.GameEndWin) { ShowUIMenu(GameOverMenu); Invoke("ReplayFromStart", 10f); } }
public void OnBeingScared(AIBase enemy, GameObject scaringObject, int scaringSize) { // Do nothing }
public void OnEndChase(AIBase enemy, GameObject chasedObject) { // Returns the eyes' color to the idle one _targetEyeColor = eyesIdleColor; }
public void OnBeginChase(AIBase enemy, GameObject chasedObject) { // Do nothing }
public void OnAttack(AIBase enemy, GameObject attackedObject, Vector3 velocity) { foreach (EnemyBehaviourListener listener in GetComponentsInChildren<EnemyBehaviourListener>()) if (listener != this) listener.OnAttack(enemy, attackedObject, velocity); }