// Use this for initialization void Start() { Anim_Menu = Menu.GetComponent <Animator>(); Anim_Btn = Btn.GetComponent <Animator>(); Anim_Config = Config_btn.GetComponent <Animator>(); Anim_foodBtn = food_btn.GetComponent <Animator>(); Anim_foodMenu = Food_Menu.GetComponent <Animator>(); }
void highlightAttackBtnSelected() { if (myExpedition.TypeOfAttackSelected == ConstantsAndEnums.possibleAttacks.explore) { exploreBtn.GetComponent <Image>().color = new Color(255, 255, 255, 255); plunderBtn.GetComponent <Image>().color = new Color(0, 0, 0, 255); razeBtn.GetComponent <Image>().color = new Color(0, 0, 0, 255); } else if (myExpedition.TypeOfAttackSelected == ConstantsAndEnums.possibleAttacks.plunder) { exploreBtn.GetComponent <Image>().color = new Color(0, 0, 0, 255); plunderBtn.GetComponent <Image>().color = new Color(255, 255, 255, 255); razeBtn.GetComponent <Image>().color = new Color(0, 0, 0, 255); } else if (myExpedition.TypeOfAttackSelected == ConstantsAndEnums.possibleAttacks.raze) { exploreBtn.GetComponent <Image>().color = new Color(0, 0, 0, 255); plunderBtn.GetComponent <Image>().color = new Color(0, 0, 0, 255); razeBtn.GetComponent <Image>().color = new Color(255, 255, 255, 255); } }
IEnumerator AddButtons() { for (int i = 0; i < Botones.Count; i++) { GameObject temp = Botones[i]; int randomIndex = Random.Range(i, Botones.Count); Botones[i] = Botones[randomIndex]; Botones[randomIndex] = temp; } int count = 1; yield return(new WaitForSeconds((float)0.7)); foreach (GameObject Btn in Botones) { Btn.transform.position = new Vector3(Btn.transform.position.x, Btn.transform.position.y - count * 6 / 7, 1); Btn.transform.SetParent(panelToAttachButtonsTo.transform); Btn.GetComponent <Animator>().enabled = true; count++; yield return(new WaitForSeconds((float)0.6)); } }