private void FlagBuyableInRabelRadios(RebelSoldiersScript relevanteRebelSoldiers) { Collider2D[] colliderInRabelRadios; colliderInRabelRadios = Physics2D.OverlapBoxAll(relevanteRebelSoldiers.transform.position, new Vector2(3, 3), 0.0f); for (int i = 0; i < colliderInRabelRadios.Length; i++) { if (colliderInRabelRadios[i].gameObject.CompareTag("BuyableObject") && ResetGivenBuyableName(colliderInRabelRadios[i].gameObject.name) != "Fort" && ResetGivenBuyableName(colliderInRabelRadios[i].gameObject.name) != "RebelSoldiers") { BuyableObjectScript buyableComponentScript = GetBuyableScriptComponent(colliderInRabelRadios[i].gameObject, ResetGivenBuyableName(colliderInRabelRadios[i].gameObject.name)); buyableComponentScript.damageFormRebelSoldier++; //TODO: write here code for damage visual effect buyableComponentScript.gameObject.GetComponent <SpriteRenderer>().color = Color.blue;//??????? if (buyableComponentScript.damageFormRebelSoldier >= 2) { buyableComponentScript.NeedToBeDestroy = true; //TODO: replace the line below with suitable visual effect buyableComponentScript.gameObject.GetComponent <SpriteRenderer>().color = Color.black; } } } }
private int GetBuyableRounOfCreation(string playerName, string buyableObjectName, int index) { BuyableObjectScript buyableScriptComponent = GetBuyableScriptComponent(buyableObjects[playerName][buyableObjectName][index], buyableObjectName); return(buyableScriptComponent.RoundOfCreation); }
public int GetBuyableId(string playerName, string buyableObjectName, int index) { BuyableObjectScript buyableScriptComponent = GetBuyableScriptComponent(buyableObjects[playerName][buyableObjectName][index], buyableObjectName); return(buyableScriptComponent.BuyableObjectId); }