Esempio n. 1
0
        private float getCurTime(ISyncScenarioItem item)
        {
            float curTime = 0.0f;

            if (item is MoveTween)
            {
                MoveTween tSh = (item as MoveTween);
                if (tSh != null)
                {
                    curTime = tSh.CurTime;
                }
            }

            if (item is AlphaTween)
            {
                AlphaTween tF = (item as AlphaTween);

                if (tF != null)
                {
                    curTime = tF.CurTime;
                }
            }

            if (item is ScaleTween)
            {
                ScaleTween tF = (item as ScaleTween);

                if (tF != null)
                {
                    curTime = tF.CurTime;
                }
            }

            return(curTime);
        }
Esempio n. 2
0
        protected virtual void OnInitialized()
        {
            alphaTween    = GetComponent <AlphaTween>();
            positionTween = GetComponent <PositionTween>();
            scaleTween    = GetComponent <ScaleTween>();

            if (alphaTween)
            {
                alphaTween.Initialize();
            }
            if (positionTween)
            {
                positionTween.Initialize();
            }
            if (scaleTween)
            {
                scaleTween.Initialize();
            }

            rectTransform = GetComponent <RectTransform>();
            layoutElement = GetComponent <LayoutElement>();

            canvasGroup = GetComponent <CanvasGroup>();
            menuScreen  = GetComponentInParent <MenuScreen>();
        }
Esempio n. 3
0
        private void Initialize()
        {
            if (initialized)
            {
                return;
            }

            Button = GetComponent <Button>();

            alphaTween  = GetComponent <AlphaTween>();
            scaleTween  = GetComponent <ScaleTween>();
            canvasGroup = GetComponent <CanvasGroup>();

            labels = new Dictionary <string, TMP_Text>();
            foreach (TMP_Text label in GetComponentsInChildren <TMP_Text>())
            {
                if (!labels.ContainsKey(label.name))
                {
                    labels.Add(label.name, label);
                }
            }

            badges = new Dictionary <string, Badge>();
            foreach (Badge badge in GetComponentsInChildren <Badge>())
            {
                if (!badges.ContainsKey(badge.name))
                {
                    badges.Add(badge.name, badge);
                }
            }

            DoParse();

            initialized = true;
        }
Esempio n. 4
0
 /// <summary>
 /// 未实现功能
 /// </summary>
 public void Expect()
 {
     if (at == null)
     {
         at = expect_img.GetComponent <AlphaTween>();
     }
     at.ResetToBeginning();
     at.PlayForward();
 }
Esempio n. 5
0
        public SimulateScenarioItem Fade(List <GameObject> goList, float endOpaque, float duration, EaseType easeType, Callback callback)
        {
            SimulateScenarioItem tweenObj = null;

            if (goList != null && goList.Count > 0)
            {
                tweenObj = new AlphaTween(convertToObjects(goList), endOpaque, duration, Ease[easeType], TweenEndValueType.To, callback);
                tweenObj.Play();
            }
            return(tweenObj);
        }
Esempio n. 6
0
 /// <summary>
 /// 警示
 /// </summary>
 public void Caution(Image _imag, bool Caution)
 {
     if (Caution)
     {
         if (NumeNUll == null)
         {
             NumeNUll = _imag.GetComponent <AlphaTween>();
         }
         NumeNUll.ResetToBeginning();
         NumeNUll.PlayForward();
     }
     else
     {
         if (Special == null)
         {
             Special = _imag.GetComponent <AlphaTween>();
         }
         Special.ResetToBeginning();
         Special.PlayForward();
     }
 }