IEnumerator DelayedHint() { yield return(new WaitForSeconds(8f)); UI_Prompt.MakePrompt( FindObjectsOfType <UI_ActionBar_ButtonAnchor>().Where(btn => btn.ButtonID == ActionButtonID.move).First().transform as RectTransform, "Select the MOVE ability.\nThen click on a tile.", 2, delegate { return(has_selected); }, true); }
IEnumerator DelayedHint() { yield return(new WaitForSeconds(6f)); UI_Prompt.MakePrompt( FindObjectsOfType <UI_ActionBar_ButtonAnchor>().Where(btn => btn.ButtonID == ActionButtonID.evac).First().transform as RectTransform, "Evacuate Units and secure valuable Supplies", 2, delegate { return(Unit.GetAllUnitsOfOwner(0, true).IsNullOrEmpty()); }, true); }
IEnumerator DelayedHint() { wait_for_hint = true; yield return(new WaitForSeconds(5f)); hint = UI_Prompt.MakePrompt( FindObjectsOfType <UI_ActionBar_ButtonAnchor>().Where(btn => btn.ButtonID == ActionButtonID.loot).First().transform as RectTransform, "Select the LOOT ability.\nThen click on the tile with loot.", 2, delegate { return(!canLoot()); }, true).gameObject; wait_for_hint = false; }
public static UI_Prompt MakePrompt(RectTransform anchor_to, string Text, int ArrowPos, Func <bool> canRemove, bool ShowButton) { GameObject obj = Instantiate(Resources.Load("UI/ui_prompt")) as GameObject; obj.transform.SetParent(GameObject.FindGameObjectWithTag("UI_Overlay").transform, false); UI_Prompt prompt = obj.GetComponent <UI_Prompt>(); (obj.transform as RectTransform).position = anchor_to.position; prompt.Init(Text, ArrowPos, canRemove, ShowButton); return(prompt); }
public override void SetActive() { base.SetActive(); Unit _player = Unit.GetAllUnitsOfOwner(0, true).FirstOrDefault(); if (_player != null) { _player.Actions.OnActionSelected += action => { if ((action as UnitAction_ApplyEffectFromWeapon) != null) { has_selected = true; } } } ; StartCoroutine(DelayedHint()); } IEnumerator DelayedHint() { yield return(new WaitForSeconds(8f)); UI_Prompt.MakePrompt( FindObjectsOfType <UI_ActionBar_ButtonAnchor>().Where(btn => btn.ButtonID == ActionButtonID.attack).First().transform as RectTransform, "Select the ATTACK ability.\nThen click on an enemy.", 2, delegate { return(has_selected); }, true); } void OnDisable() { Unit.OnUnitKilled -= OnKilled; } void StopTimer() { has_selected = true; StopAllCoroutines(); } }
// Use this for initialization void Start() { UI_Prompt.MakePrompt(this.transform as RectTransform, "TEST OMG", 2, CanRemove, true); }
void ShowStimpackPrompt() { UI_Prompt.MakePrompt(UI_ActionBar_ButtonAnchor.GetAnchor(ActionButtonID.stim), "Use stimpacks to regain Oxygen. Units without oxygen, die.", 2, delegate { return(!CanShowStimpackPrompt()); }, true); }
void ShowSpecialPrompt() { ADR_Prompt_Shown++; UI_Prompt.MakePrompt(UI_ActionBar_ButtonAnchor.GetAnchor(ActionButtonID.special_atk_1), "Use the more powerful \"Special Attack\" to kill the target", 2, delegate { return(!rush.HasRush); }, true); }