private void InstantiateBackButton() { // Instantiate Button and make it child of this game object if (backButton == null) { backButtonPrefab = Resources.Load <Button>("Back Button"); backButton = Instantiate(backButtonPrefab, transform, false); backButton.onClick.AddListener(DoBackOnThisObject); backButton.name = backButtonPrefab.name; backBtnAnimatedElement = backButton.GetComponent <AiryUIAnimatedElement>(); img = backButton.transform.Find("Image").GetComponent <Image>(); txt = backButton.transform.Find("Text").GetComponent <Text>(); backBtnAnimatedElement.withDelay = true; backBtnAnimatedElement.showDelay = showDelay; backBtnAnimatedElement.ShowElement(); SetPositionAndScale(); SetGraphics(); } else { SetGraphics(); SetPositionAndScale(); } }
private void OnEnable() { animationP = (AiryUIAnimatedElement)target; _showItemOnMenuEnable = serializedObject.FindProperty("showItemOnMenuEnable"); _animationShowDuration = serializedObject.FindProperty("animationShowDuration"); _animationHideDuration = serializedObject.FindProperty("animationHideDuration"); _pivotWhileRotating = serializedObject.FindProperty("pivotWhileRotating"); _rotateFrom = serializedObject.FindProperty("rotateFrom"); _rotateTo = serializedObject.FindProperty("rotateTo"); _showAnimationType = serializedObject.FindProperty("showAnimationType"); _hideAnimationType = serializedObject.FindProperty("hideAnimationType"); _animationFromCornerStartFromType = serializedObject.FindProperty("animationFromCornerStartFromType"); _fadeChildren = serializedObject.FindProperty("fadeChildren"); _animationFromCornerType = serializedObject.FindProperty("animationFromCornerType"); _animationToCornerType = serializedObject.FindProperty("animationToCornerType"); _elasticPower = serializedObject.FindProperty("elasticityPower"); _withDelay = serializedObject.FindProperty("withDelay"); _showDelay = serializedObject.FindProperty("showDelay"); _hideDelay = serializedObject.FindProperty("hideDelay"); _onShowEvent = serializedObject.FindProperty("OnShow"); _onHideEvent = serializedObject.FindProperty("OnHide"); _onShowCompleteEvent = serializedObject.FindProperty("OnShowComplete"); _onHideCompleteEvent = serializedObject.FindProperty("OnHideComplete"); }
private void Awake() { rectTransform = GetComponent <RectTransform>(); animatedElement = GetComponent <AiryUIAnimatedElement>(); InstantiateManager(); }
private void Awake() { rectTransform = GetComponent <RectTransform>(); animatedElement = GetComponent <AiryUIAnimatedElement>(); backButtonPrefab = Resources.Load <Button>("Back Button"); InstantiateManager(); }
private IEnumerator InstantiateBackButton() { // Instantiate Button and make it child of this game object if (backButton == null) { yield return(new WaitForSeconds(showDelay)); backButton = Instantiate(backButtonPrefab, transform, false); backButton.onClick.AddListener(DoBackOnThisObject); backButton.name = backButtonPrefab.name; backBtnAnimatedElement = backButton.GetComponent <AiryUIAnimatedElement>(); backBtnAnimatedElement.OnShowComplete.AddListener(() => AiryUIAnchors.SetAnchorsToRect(backBtnAnimatedElement.GetComponent <RectTransform>())); img = backButton.transform.Find("Image").GetComponent <Image>(); txt = backButton.transform.Find("Text").GetComponent <Text>(); SetGraphics(); SetPositionAndScale(); backBtnAnimatedElement.ShowElement(); } }