public void AddTargetArrowUI(Color arrowColor) { ArrowUI newArrow = Instantiate <ArrowUI>(targetPrefab, targetParent); newArrow.SetColor(arrowColor); targetArrows.Add(newArrow); }
public void ClearArrowsUIOfColor(Color arrowColor) { for (int i = this.targetArrows.Count - 1; i >= 0; i--) { ArrowUI arrow = this.targetArrows[i]; if (arrow.curArrowColor == arrowColor) { Destroy(arrow.gameObject); this.targetArrows.RemoveAt(i); } } }
public void PonyPicked(ArrowUI pony) { Action <string> processResponse = (string response) => { if (response != null) { //ShowButtons(); PF_PlayerData.CreateNewCharacter(response, pony.details); } }; string[] randomNames = new string[] { "Sparkle", "Twinkle", "PowerHoof", "Nova", "Lightning", "ReignBow", "Charlie", "Balloonicorn", "Roach" }; int rng = UnityEngine.Random.Range(0, randomNames.Length); DialogCanvasController.RequestTextInputPrompt(GlobalStrings.CHAR_NAME_PROMPT, GlobalStrings.CHAR_NAME_MSG, processResponse, randomNames[rng]); }
public void SwitchPonyDetails(ArrowUI character) { if (character.details == null || character.details.CatalogCode == null) { return; } var ponyType = (PF_PlayerData.PlayerClassTypes)Enum.Parse(typeof(PF_PlayerData.PlayerClassTypes), character.details.CatalogCode); switch ((int)ponyType) { case 0: foreach (var item in colorize) { item.color = PF_GamePlay.ClassColor1; } break; case 1: foreach (var item in colorize) { item.color = PF_GamePlay.ClassColor2; } break; case 2: foreach (var item in colorize) { item.color = PF_GamePlay.ClassColor3; } break; default: Debug.LogWarning("Unknown Class type detected..."); break; } hp.text = character.details.BaseHP.ToString(); dp.text = character.details.BaseDP.ToString(); sp.text = character.details.BaseSP.ToString(); SetSpellInfo(character.details.Spell1, 0); SetSpellInfo(character.details.Spell2, 1); SetSpellInfo(character.details.Spell3, 2); }
public void SelectSlot(ArrowUI go) { if (this.selectedSlot == go || this.cPicker.selectedSlot.saved != null) { return; } else { this.selectedPonyUI.gameObject.SetActive(false); int arrowIndex = 0; if (go.tag == "Arrow1") { arrowIndex = 0; } else if (go.tag == "Arrow2") { arrowIndex = 1; } else { arrowIndex = 2; } UnityEvent afterSelect = new UnityEvent(); afterSelect.AddListener(() => { this.selectedPonyUI.gameObject.SetActive(true); TweenScale.Tween(this.confirmButton.gameObject, .5f, new Vector3(1, 1, 1), new Vector3(1.1f, 1.1f, 1.1f), TweenMain.Style.PingPong, TweenMain.Method.Linear, null); }); UnityEvent afterDeselect = new UnityEvent(); afterDeselect.AddListener(() => { this.selectedSlot = go; this.selectedPonyUI.SwitchPonyDetails(go); SelectArrow(arrowIndex, afterSelect); }); //afterDeselect.Invoke(); DeselectArrows(afterDeselect); } }
public void TurnOnArrows(UnityEvent callback = null) { //Debug.Log(this.ArrowGroup.rect.width); this.selectedSlot = null; TweenPos.Tween(this.ArrowGroup.gameObject, .333f, new Vector3(445, 30, 0), () => { this.Arrow1.btn.interactable = true; this.Arrow1.currentState = AnimationStates.On; this.Arrow2.btn.interactable = true; this.Arrow2.currentState = AnimationStates.On; this.Arrow3.btn.interactable = true; this.Arrow3.currentState = AnimationStates.On; if (callback != null) { callback.Invoke(); } }, Space.Self); }
public void SwitchPonyDetails(ArrowUI pony) { if (pony.details != null && pony.details.CatalogCode != null) { PF_PlayerData.PlayerClassTypes ponyType = (PF_PlayerData.PlayerClassTypes)Enum.Parse(typeof(PF_PlayerData.PlayerClassTypes), pony.details.CatalogCode); switch ((int)ponyType) { case 0: foreach (var item in this.colorize) { item.color = PF_GamePlay.ClassColor1; } break; case 1: foreach (var item in this.colorize) { item.color = PF_GamePlay.ClassColor2; } break; case 2: foreach (var item in this.colorize) { item.color = PF_GamePlay.ClassColor3; } break; default: Debug.LogWarning("Unknown Class type detected..."); break; } hp.text = string.Format("{0}", pony.details.BaseHP); dp.text = string.Format("{0}", pony.details.BaseDP); sp.text = string.Format("{0}", pony.details.BaseSP); if (PF_GameData.Spells.ContainsKey(pony.details.Spell1)) { spells[0].spellName.text = pony.details.Spell1; spells[0].spellImage.overrideSprite = GameController.Instance.iconManager.GetIconById(PF_GameData.Spells[pony.details.Spell1].Icon); spells[0].attackValue.text = "" + PF_GameData.Spells[pony.details.Spell1].BaseDmg; spells[0].upgradeLevels.text = "" + PF_GameData.Spells[pony.details.Spell1].UpgradeLevels; spells[0].cooldown.text = "" + PF_GameData.Spells[pony.details.Spell1].Cooldown; spells[0].levelReq.text = "" + PF_GameData.Spells[pony.details.Spell1].LevelReq; } if (PF_GameData.Spells.ContainsKey(pony.details.Spell2)) { spells[1].spellName.text = pony.details.Spell2; spells[1].spellImage.overrideSprite = GameController.Instance.iconManager.GetIconById(PF_GameData.Spells[pony.details.Spell2].Icon); spells[1].attackValue.text = "" + PF_GameData.Spells[pony.details.Spell2].BaseDmg; spells[1].upgradeLevels.text = "" + PF_GameData.Spells[pony.details.Spell2].UpgradeLevels; spells[1].cooldown.text = "" + PF_GameData.Spells[pony.details.Spell2].Cooldown; spells[1].levelReq.text = "" + PF_GameData.Spells[pony.details.Spell2].LevelReq; } if (PF_GameData.Spells.ContainsKey(pony.details.Spell3)) { spells[2].spellName.text = pony.details.Spell3; spells[2].spellImage.overrideSprite = GameController.Instance.iconManager.GetIconById(PF_GameData.Spells[pony.details.Spell3].Icon); spells[2].attackValue.text = "" + PF_GameData.Spells[pony.details.Spell3].BaseDmg; spells[2].upgradeLevels.text = "" + PF_GameData.Spells[pony.details.Spell3].UpgradeLevels; spells[2].cooldown.text = "" + PF_GameData.Spells[pony.details.Spell3].Cooldown; spells[2].levelReq.text = "" + PF_GameData.Spells[pony.details.Spell3].LevelReq; } } }