IEnumerator SetNextFrameHide() { yield return(0); foreach (GameObject go in GoList) { TweenToggle toggle = go.GetComponent <TweenToggle>(); if (toggle != null) { if (hideImmediately) { //Debug.Log(" -- - - HIDE BOOLEAN TRUE"); // TODO Need to call last hide object last!!!! toggle.hideDuration = 0f; toggle.hideDelay = 0f; } toggle.Hide(); } } // If set to begin hide callback, call it now! if (!isHideFinishedCallback) { HideSendCallback(); } }
public void Show(string material) { AssignMaterial(material); TweenToggle toggle = GetComponent <TweenToggle>(); toggle.ShowFunctionName = "DecreaseCameraClip"; // Assigning callback toggle.Show(); }
public void LgReset() { if (UIRayCastBlock != null) { UIRayCastBlock.blocksRaycasts = startsHidden ? false : true; } foreach (GameObject go in GoList) { TweenToggle toggle = go.GetComponent <TweenToggle>(); toggle.startsHidden = startsHidden; toggle.Reset(); } }
// Event listener. listening to when decoration mode is enabled/disabled private void ShowDecoZones(object sender, UIManagerEventArgs args) { TweenToggle toggle = GetComponent <ScaleTweenToggle>(); if (args.Opening) { toggle.Show(); // edit mode is opening, so turn this node on } else { toggle.Hide(); // edit mode is closing so turn this node off } }
/// <summary> /// Sets the sprite on this UI's checkbox based on the status of the task. /// </summary> private void SetCheckboxSprite(bool isPop, TweenToggle slash) { // get the status WellapadTaskCompletionStates eStatus = WellapadMissionController.Instance.GetTaskStatus(task, isPop); // show the tween only if the status is complete OR the status is recently completed and we are popping the task status if (eStatus == WellapadTaskCompletionStates.Completed || (eStatus == WellapadTaskCompletionStates.RecentlyCompleted && isPop)) { // mark this task as done slash.gameObject.SetActive(true); StartCoroutine(CheckboxSpriteShowHelper(slash)); // Show after one frame } }
IEnumerator SetNextFrameShow() { yield return(0); foreach (GameObject go in GoList) { TweenToggle toggle = go.GetComponent <TweenToggle>(); if (toggle != null) { toggle.Show(); } } // If set to begin show callback, call it now! if (!isShowFinishedCallback) { ShowSendCallback(); } }
public CanvasGroup UIRayCastBlock; // If this is assigned, it will attempt to block (ONLY) UI Raycasts when shown void Awake() { if (startsHidden) { isShown = false; isMoving = false; } else { isShown = true; isMoving = false; } foreach (GameObject go in GoList) { TweenToggle toggle = go.GetComponent <TweenToggle>(); if (toggle != null) { if (startsHidden) { toggle.startsHidden = true; // TweenToggle Start() will take care of setting position } else { toggle.startsHidden = false; } } } if (lastFinishedShowObject != null) { lastFinishedShowObjectScript = lastFinishedShowObject.GetComponent <TweenToggle>(); } if (lastFinishedHideObject != null) { lastFinishedHideObjectScript = lastFinishedHideObject.GetComponent <TweenToggle>(); } }
private IEnumerator CheckboxSpriteShowHelper(TweenToggle slash) { yield return(0); slash.Show(); }
// Called from minipet script children themselves public void OpenUIMinipetType(MiniPetTypes type, Hashtable hash, MonoBehaviour baseScript) { GameObject contentPrefab; switch (type) { case MiniPetTypes.Retention: minipetType = MiniPetTypes.Retention; //Debug.Log(DataManager.Instance.GameData.Wellapad.CurrentTasks.ContainsKey(hash[0].ToString())); if (DataManager.Instance.GameData.Wellapad.CurrentTasks.ContainsKey(hash[0].ToString())) { // Debug.Log(DataManager.Instance.GameData.Wellapad.CurrentTasks[hash[0].ToString()].RewardStatus); if (DataManager.Instance.GameData.Wellapad.CurrentTasks[hash[0].ToString()].isReward == RewardStatuses.Unclaimed || DataManager.Instance.GameData.Wellapad.CurrentTasks[hash[0].ToString()].isReward == RewardStatuses.Unearned) { contentPrefab = Resources.Load("ContentParentRetention") as GameObject; content = GameObjectUtils.AddChildWithPositionAndScale(contentParent, contentPrefab); content.GetComponentInChildren <Button>().onClick.AddListener(() => MiniPetManager.Instance.MiniPetTable["MiniPet0"].GetComponent <MiniPetRetentionPet>().OnTurnInButton()); MiniPetRetentionUIController minipetRetentionUIController = content.GetComponent <MiniPetRetentionUIController>(); minipetRetentionUIController.InitializeContent(hash[0].ToString(), (MiniPetRetentionPet)baseScript); SelectedMiniPetContentUIScript = minipetRetentionUIController; if (TutorialManager.Instance == null || !TutorialManager.Instance.IsTutorialActive()) { contentTweenParent = content.GetComponent <TweenToggle>(); //if(IsOpen() && (contentTweenParent != null)){ // Pet just finished eating, show asap HACK if (contentTweenParent != null) { StartCoroutine(ShowContentHelper()); } } } } break; case MiniPetTypes.GameMaster: minipetType = MiniPetTypes.GameMaster; if (DataManager.Instance.GameData.Wellapad.CurrentTasks[hash[0].ToString()].isReward == RewardStatuses.Unclaimed || DataManager.Instance.GameData.Wellapad.CurrentTasks[hash[0].ToString()].isReward == RewardStatuses.Unearned) { contentPrefab = Resources.Load("ContentParentGameMaster") as GameObject; content = GameObjectUtils.AddChildWithPositionAndScale(contentParent, contentPrefab); MinigameTypes minigameType = (MinigameTypes)Enum.Parse(typeof(MinigameTypes), hash[1].ToString()); content.GetComponentInChildren <Button>().onClick.AddListener(() => MiniPetManager.Instance.MiniPetTable["MiniPet1"].GetComponent <MiniPetGameMaster>().OnTurnInButton()); MiniPetGameMasterUIController minipetGameMasterUIController = content.GetComponent <MiniPetGameMasterUIController>(); minipetGameMasterUIController.InitializeContent(hash[0].ToString(), minigameType, (MiniPetGameMaster)baseScript); SelectedMiniPetContentUIScript = minipetGameMasterUIController; if (TutorialManager.Instance == null || !TutorialManager.Instance.IsTutorialActive()) { contentTweenParent = content.GetComponent <TweenToggle>(); //if(IsOpen() && (contentTweenParent != null)){ // Pet just finished eating, show asap HACK if (contentTweenParent != null) { StartCoroutine(ShowContentHelper()); } } } break; case MiniPetTypes.Merchant: minipetType = MiniPetTypes.Merchant; contentPrefab = Resources.Load("ContentParentMerchant") as GameObject; content = GameObjectUtils.AddChildWithPositionAndScale(contentParent, contentPrefab); ItemType itemType = (ItemType)Enum.Parse(typeof(ItemType), hash[1].ToString()); MiniPetMerchantUIController minipetMerchantUIController = content.GetComponent <MiniPetMerchantUIController>(); minipetMerchantUIController.InitializeContent(hash[0].ToString(), false, itemType, (MiniPetMerchant)baseScript); SelectedMiniPetContentUIScript = minipetMerchantUIController; if (TutorialManager.Instance == null || !TutorialManager.Instance.IsTutorialActive()) { contentTweenParent = content.GetComponent <TweenToggle>(); //if(IsOpen() && (contentTweenParent != null)){ // Pet just finished eating, show asap HACK if (contentTweenParent != null) { StartCoroutine(ShowContentHelper()); } } break; default: minipetType = MiniPetTypes.None; Debug.LogError("No minipet type found: " + type.ToString()); return; } }