//Function : MovToEnemySoilderFunction //Method : This is the Function that used //For Moving To The Enemy Soilder public void MovToEnemySoilderFunction(Vector3 pos, AISOILDERCtrlScript soilderCtrlScript = null) { // Debug.Log("Has Been Called in Scoop Script "); StopCoroutine(DOTalkingIEmerator()); StopCoroutine(DODANCEIEnumerator()); isMoving = true; aiSoilderCtrlScript = soilderCtrlScript; if (aiSoilderCtrlScript == null) { isDoingFighting = false; if (WeaponObj != null) { WeaponObj.SetActive(false); } SettingStatement(SCOOPENUMCrtStatement.IDLE); return; } if (aiSoilderCtrlScript != null) { isDoingFighting = true; anim.SetBool(AnimEQUIPWEAPONBooleanString, true); anim.SetBool(AnimMovingBooleanString, true); anim.SetBool(AnimisTalkingBooleanString, false); anim.SetBool(AnimDODanceBoolean, false); anim.ResetTrigger(AnimAttackTriggerString); SettingStatement(SCOOPENUMCrtStatement.MovToFighting); navMeshAgents.isStopped = false; navMeshAgents.stoppingDistance = 1.5f; navMeshAgents.SetDestination(pos); if (WeaponObj != null) { WeaponObj.SetActive(true); } scoopCrtStatementScript.SetAttackSpriteFunction(); } }
//Function : GetComponentFunction //Method : This is the Function that used //For Getting the component void GetComponentFunction() { if (aiSoilderCtrlScript == null) { aiSoilderCtrlScript = GetComponentInParent <AISOILDERCtrlScript>(); } }
void MovingToTheSoilderFunction(ScoopScript[] SC, AISOILDERCtrlScript aiCtrlScript, Vector3 targetPos) { for (int i = 0; i < SC.Length; i++) { if (SC[i].energyType.CrtSpirit > 0) { SC[i].MovToEnemySoilderFunction(targetPos, aiCtrlScript); } } }
//Function : MovToPositionFunction //Method : This is the Function used For Moving To //The Destination public void MovToPositionFunction(Vector3 pos) { if (energyType.CrtSpirit <= 0) { SettingStatement(SCOOPENUMCrtStatement.IDLE); return; } else if (energyType.CrtSpirit > 0) { anim.SetBool(AnimisTiringBooleanString, false); SettingStatement(SCOOPENUMCrtStatement.MovingToDestination); } StopCoroutine(DOTalkingIEmerator()); StopCoroutine(DODANCEIEnumerator()); isMoving = true; isDoingFighting = false; aiSoilderCtrlScript = null; // navMeshAgents.stoppingDistance = Random.Range(0.2f, 0.9f); navMeshAgents.stoppingDistance = Random.Range(0.8f, 1.45f); SettingStatement(SCOOPENUMCrtStatement.MovingToDestination); anim.SetBool(AnimFarmingBooleanString, false); anim.SetBool(AnimGatheringBooleanString, false); anim.SetBool(AnimisAxeingBooleanString, false); anim.SetBool(AnimisHammeringBooleanString, false); anim.SetBool(AnimisTalkingBooleanString, false); anim.SetBool(AnimMovingBooleanString, true); anim.SetBool(AnimDODanceBoolean, false); anim.SetBool(AnimEQUIPWEAPONBooleanString, false); anim.ResetTrigger(AnimAttackTriggerString); resourceCollectiveScript = null; navMeshAgents.isStopped = false; navMeshAgents.SetDestination(pos); FarmingObject.SetActive(false); if (AxeObject != null) { AxeObject.SetActive(false); } if (WeaponObj != null) { WeaponObj.SetActive(false); } }
//Function : TalkingToAntherPlayerStatementFunction public void TalkingToAnotherPlayerStatementFunction(Vector3 pos, GameObject talkingPlayerObject = null) { // Debug.Log("Mov To Another Player Statement"); // SettingStatement(SCOOPENUMCrtStatement.MovToTalking); isMoving = true; if (!isFarming) { anim.SetBool(AnimMovingBooleanString, true); anim.SetBool(AnimFarmingBooleanString, false); anim.SetBool(AnimGatheringBooleanString, false); anim.SetBool(AnimisHammeringBooleanString, false); anim.SetBool(AnimisAxeingBooleanString, false); anim.SetBool(AnimDODanceBoolean, false); anim.SetBool(AnimisTalkingBooleanString, false); anim.SetBool(AnimEQUIPWEAPONBooleanString, false); anim.ResetTrigger(AnimAttackTriggerString); navMeshAgents.isStopped = false; aiSoilderCtrlScript = null; navMeshAgents.stoppingDistance = 1.5f; if (WeaponObj != null) { WeaponObj.SetActive(false); } // navMeshAgents.SetDestination(pos); lookAtPlayerPosition = pos; } HaveTalkingPLAYERObj = talkingPlayerObject; }
//Function : MovToResourceFunction //Method : This is the Function used For Soilder who are going to The Resource Area public void MovToResourceFunction(Vector3 pos, SCOOPENUMCrtStatement scoopEnumType, ResourceCollectiveScript setResourceSource = null) { SettingStatement(scoopEnumType); StopCoroutine(DOTalkingIEmerator()); isMoving = true; aiSoilderCtrlScript = null; anim.SetBool(AnimMovingBooleanString, true); anim.SetBool(AnimFarmingBooleanString, false); anim.SetBool(AnimGatheringBooleanString, false); anim.SetBool(AnimisHammeringBooleanString, false); anim.SetBool(AnimisAxeingBooleanString, false); anim.SetBool(AnimDODanceBoolean, false); anim.SetBool(AnimisTalkingBooleanString, false); anim.SetBool(AnimEQUIPWEAPONBooleanString, false); anim.ResetTrigger(AnimAttackTriggerString); navMeshAgents.isStopped = false; navMeshAgents.stoppingDistance = Random.Range(0.8f, 1.8f); navMeshAgents.SetDestination(pos); FarmingObject.SetActive(false); resourceCollectiveScript = setResourceSource; if (AxeObject != null) { AxeObject.SetActive(false); } HammerObject.SetActive(false); scoopCrtStatementScript.SetIldeSpriteFunction(); }
//Function : MovToFightFunction //Method : This is the Functio that used //For Moving To Fighting Statement void MovToFightFunction() { if (aiSoilderCtrlScript == null) { SettingStatement(SCOOPENUMCrtStatement.IDLE); return; } if (aiSoilderCtrlScript != null) { if (aiSoilderCtrlScript.isDead) { SettingStatement(SCOOPENUMCrtStatement.IDLE); aiSoilderCtrlScript = null; return; } } anim.SetBool(AnimisTalkingBooleanString, false); anim.SetBool(AnimFarmingBooleanString, false); anim.SetBool(AnimisHammeringBooleanString, false); anim.SetBool(AnimisAxeingBooleanString, false); anim.SetBool(AnimGatheringBooleanString, false); if (Vector3.Distance(transform.position, navMeshAgents.destination) <= navMeshAgents.stoppingDistance) { StopCoroutine(DOTalkingIEmerator()); StopCoroutine(DODANCEIEnumerator()); isMoving = false; anim.SetBool(AnimMovingBooleanString, false); SettingStatement(SCOOPENUMCrtStatement.Fighting); } }
void InstantiateSoilderFunction() { InstanSoilderAreaScript instantiateSoilderScript = FindObjectOfType <InstanSoilderAreaScript>(); for (int i = 0; i < instantiateSoilderScript.GetTransformListToArrayFunction().Length; i++) { Transform[] instanBoss = instantiateSoilderScript.GetTransformListToArrayFunction(); if (InstanSoilderAreaScript.Count < instanBoss.Length) { for (int j = InstanSoilderAreaScript.Count; j < instanBoss.Length; j++) { GameObject instanSoilder = Instantiate(SoilderGameObjects, instanBoss[j].position, Quaternion.identity); AISOILDERCtrlScript aisoilderScript = instanSoilder.GetComponent <AISOILDERCtrlScript>(); InstanSoilderAreaScript.Add(aisoilderScript); } } } }
//Function : InstanEnemyFunction //Method : This is the Function that used //For InstanEnemyFunction public void InstanEnemyFunction() { Vector3 vector3 = new Vector3(transform.position.x + Random.Range(-1.5f, 1.5f), transform.position.y, transform.position.z + Random.Range(-1.5f, 1.5f)); if (!Unlocked) { if (isStage1) { if (GameManager.instance.lvl1UnlockEnemiesCount.Count < CrtCount) { for (int i = GameManager.instance.lvl1UnlockEnemiesCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl1UnlockEnemiesCount.Add(aiSoilderScript); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 1 "); } } } else if (isStage2) { if (GameManager.instance.lvl2UnlockEnemiesCount.Count < CrtCount) { for (int i = GameManager.instance.lvl2UnlockEnemiesCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.InstanboxColliderScript(this); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 2"); GameManager.instance.lvl2UnlockEnemiesCount.Add(aiSoilderScript); } } } else if (isStage3) { if (GameManager.instance.lvl3UnlockEnemiesCount.Count < CrtCount) { for (int i = GameManager.instance.lvl3UnlockEnemiesCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.InstanboxColliderScript(this); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 3"); GameManager.instance.lvl3UnlockEnemiesCount.Add(aiSoilderScript); } } } else if (isStage4) { if (GameManager.instance.lvl4UnlockEnemyCount.Count < CrtCount) { for (int i = GameManager.instance.lvl4UnlockEnemyCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 4"); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl4UnlockEnemyCount.Add(aiSoilderScript); } } } else if (isStage5) { if (GameManager.instance.lvl5UnlockEnemyCount.Count < CrtCount) { for (int i = GameManager.instance.lvl5UnlockEnemyCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 5"); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl5UnlockEnemyCount.Add(aiSoilderScript); } } } else if (isStage6) { if (GameManager.instance.lvl6UnlockEnemyCount.Count < CrtCount) { for (int i = GameManager.instance.lvl6UnlockEnemyCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 6"); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl6UnlockEnemyCount.Add(aiSoilderScript); } } } else if (isStage7) { if (GameManager.instance.lvl7UnlockEnemyCount.Count < CrtCount) { for (int i = GameManager.instance.lvl7UnlockEnemyCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 7"); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl7UnlockEnemyCount.Add(aiSoilderScript); } } } else if (isStage8) { HaveLevelToUnlockThisGroundScript haveLevelToUnlock = GetComponent <HaveLevelToUnlockThisGroundScript>(); haveLevelToUnlock.isUnlock = Unlocked; GoldenCost = haveLevelToUnlock.Cost; } else if (isStage9) { if (GameManager.instance.lvl9UnlockEnemyCount.Count < CrtCount) { for (int i = GameManager.instance.lvl9UnlockEnemyCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 9"); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl9UnlockEnemyCount.Add(aiSoilderScript); } } } else if (isStage10) { if (GameManager.instance.lvl10UnlockEnemyCount.Count < CrtCount) { for (int i = GameManager.instance.lvl10UnlockEnemyCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 10"); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl10UnlockEnemyCount.Add(aiSoilderScript); } } } else if (isStage11) { if (GameManager.instance.lvl11UnlockEnemyCount.Count < CrtCount) { for (int i = GameManager.instance.lvl11UnlockEnemyCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 10"); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl11UnlockEnemyCount.Add(aiSoilderScript); } } } else if (isStage12) { if (GameManager.instance.lvl12UnlockEnemyCount.Count < CrtCount) { for (int i = GameManager.instance.lvl12UnlockEnemyCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 12"); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl12UnlockEnemyCount.Add(aiSoilderScript); } } } else if (isStage13) { HaveLevelToUnlockThisGroundScript haveLevelToUnlock = GetComponent <HaveLevelToUnlockThisGroundScript>(); haveLevelToUnlock.isUnlock = Unlocked; GoldenCost = haveLevelToUnlock.Cost; } else if (isStage14) { if (GameManager.instance.lvl14UnlockEnemyCount.Count < CrtCount) { for (int i = GameManager.instance.lvl14UnlockEnemyCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 14"); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl14UnlockEnemyCount.Add(aiSoilderScript); } } } else if (isStage15) { if (GameManager.instance.lvl15UnlockEnemyCount.Count < CrtCount) { for (int i = GameManager.instance.lvl15UnlockEnemyCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 15"); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl15UnlockEnemyCount.Add(aiSoilderScript); } } } else if (isStage16) { if (GameManager.instance.lvl16UnlockEnemyCount.Count < CrtCount) { for (int i = GameManager.instance.lvl16UnlockEnemyCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 16"); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl16UnlockEnemyCount.Add(aiSoilderScript); } } } else if (isStage17) { if (GameManager.instance.lvl17UnlockEnemyCount.Count < CrtCount) { for (int i = GameManager.instance.lvl17UnlockEnemyCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 17"); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl17UnlockEnemyCount.Add(aiSoilderScript); } } } else if (isStage18) { if (GameManager.instance.lvl18UnlockEnemyCount.Count < CrtCount) { for (int i = GameManager.instance.lvl18UnlockEnemyCount.Count; i < CrtCount; i++) { GameObject InstanEnemyObj = Instantiate(GameManager.instance.GetSoilderEnemyObject(), vector3, Quaternion.identity); if (GameManager.instance.GetSoilderTroopParentTransform()) { InstanEnemyObj.transform.SetParent(GameManager.instance.GetSoilderTroopParentTransform()); } AISOILDERCtrlScript aiSoilderScript = InstanEnemyObj.GetComponent <AISOILDERCtrlScript>(); aiSoilderScript.GetAISoilderManager().SetTextMeshFunction("Level 18"); aiSoilderScript.InstanboxColliderScript(this); GameManager.instance.lvl18UnlockEnemyCount.Add(aiSoilderScript); } } } else if (isStage19) { } } }
//Function : SetEnemySoilderFunctiontoNULLFunction //Method : This is the Function used For Setting The Enemy //Soilder to NULL Statement public void SetEnemySoilderFunctionToNULLFunction() { aiSoilderCtrlScript = null; SettingStatement(SCOOPENUMCrtStatement.IDLE); }
//Function : SettingStatement //Method : This Function is used For Setting The Function which is Setting The Statement public void SettingStatement(SCOOPENUMCrtStatement toscoop) { scoopEnum = toscoop; if (this.gameObject != null) { if (scoopEnum == SCOOPENUMCrtStatement.IDLE) { isMoving = false; isFarming = false; resourceCollectiveScript = null; navMeshAgents.isStopped = true; anim.SetBool(AnimMovingBooleanString, false); anim.SetBool(AnimFarmingBooleanString, false); anim.SetBool(AnimGatheringBooleanString, false); anim.SetBool(AnimisAxeingBooleanString, false); anim.SetBool(AnimisHammeringBooleanString, false); anim.SetBool(AnimisTalkingBooleanString, false); anim.ResetTrigger(AnimAttackTriggerString); SetTalkingBooleanStatement(false); if (energyType.CrtSpirit <= 0) { anim.SetBool(AnimisTiringBooleanString, true); } else if (energyType.CrtSpirit > 0) { anim.SetBool(AnimisTiringBooleanString, false); } navMeshAgents.ResetPath(); if (FarmingObject != null) { FarmingObject.SetActive(false); } if (AxeObject != null) { AxeObject.SetActive(false); } if (HammerObject != null) { HammerObject.SetActive(false); } if (WeaponObj != null) { WeaponObj.SetActive(false); } isDoingFighting = false; aiSoilderCtrlScript = null; } } }
//Function : TakeDamageFunction //Method : This is the Function used To Check The Take DamageFunction public void TakeDamageFunction() { TakeDamageBoolean = true; // Debug.Log("You Have Been Take Damage "); if (HasWeaponBoolean) { energyType.CrtHP--; } else { energyType.CrtHP -= 2; } if (energyType.CrtHP <= 0) { isDead = true; if (PlayerManagerScript.instance.scoopScriptList.Contains(this)) { if (SelectedScoopScript.instance.scoopListScript.Contains(this)) { PlayerManagerScript.instance.scoopScriptList.Remove(this); SelectedScoopScript.instance.scoopListScript.Remove(this); } } } if (anim.GetBool(AnimEQUIPWEAPONBooleanString) == true) { if (!isDead) { anim.SetTrigger(AnimGetTriggerString); } } if (isDead) { anim.Play(AnimDEATHString); anim.applyRootMotion = true; rgbd.useGravity = false; aiSoilderCtrlScript = null; switch (scoopEnumType) { case ScoopEnumType.Farmer: PlayerManagerScript.instance.GETFARMERINTEGER--; break; case ScoopEnumType.Gathering: PlayerManagerScript.instance.GETFRUITCOLLECTOR--; break; case ScoopEnumType.Axe: PlayerManagerScript.instance.GETAXERInterger--; break; case ScoopEnumType.Hammer: PlayerManagerScript.instance.GETHAMMERINTEGER--; break; } PlayerManagerScript.instance.UpdateCurrentTheCostAndCountHavePassedFunction(); Destroy(capCollider); StartCoroutine(DeadIEnumerator()); if (scoopCrtStatementScript.GetEmotionBubbleGameObject() != null) { scoopCrtStatementScript.GetEmotionBubbleGameObject().gameObject.SetActive(false); } if (HasBeenSelectorObject.activeInHierarchy) { HasBeenSelectorObject.SetActive(false); } } }
//Function : FightingUpdateStatement //Method : This is the Function used For Setting //The Function void FightingUpdateStatement() { if (TakeDamageBoolean) { return; } if (aiSoilderCtrlScript == null) { SettingStatement(SCOOPENUMCrtStatement.IDLE); return; } if (aiSoilderCtrlScript != null) { if (energyType.CrtSpirit > 0) { if (Time.time > attackCrtTimer) { anim.SetBool(AnimisTalkingBooleanString, false); attackCrtTimer = Time.time + attackDelayTimer; switch (scoopEnumType) { case ScoopEnumType.Farmer: energyType.fighterEnergy = Random.Range(16f, 19f); break; case ScoopEnumType.Gathering: energyType.fighterEnergy = Random.Range(14.5f, 17f); break; case ScoopEnumType.Axe: energyType.fighterEnergy = Random.Range(9.2f, 11.8f); break; case ScoopEnumType.Hammer: energyType.fighterEnergy = Random.Range(6f, 7f); break; } attackDelayTimer = energyType.fighterEnergy; LOOKAT(aiSoilderCtrlScript.transform.position); // aiSoilderCtrlScript.TakeDamageFunction(); anim.SetTrigger(AnimAttackTriggerString); } scoopCrtStatementScript.SetAttackSpriteFunction(); anim.SetBool(AnimisTalkingBooleanString, false); } else if (energyType.CrtSpirit <= 0) { SettingStatement(SCOOPENUMCrtStatement.IDLE); } if (aiSoilderCtrlScript.isDead) { aiSoilderCtrlScript = null; SettingStatement(SCOOPENUMCrtStatement.IDLE); return; } } FarmingObject.SetActive(false); if (AxeObject != null) { AxeObject.SetActive(false); } if (HammerObject != null) { HammerObject.SetActive(false); } movingToTalkingCrtStatement = 0.0f; StopCoroutine(DOTalkingIEmerator()); }