Example #1
0
        protected override void Awake()
        {
            base.Awake();

            m_containerType = ContainerType.Control;
            m_controlType   = ControlType.IMCDropdown;
#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                return;
            }
#endif

            m_AlphaTweenRunner = new TweenRunner <FloatTween>();
            m_AlphaTweenRunner.Init(this);

            if (m_CaptionImage)
            {
                m_CaptionImage.enabled = (m_CaptionImage.sprite != null);
            }

            if (m_Template)
            {
                m_Template.gameObject.SetActive(false);
            }
        }
		// Called by Unity prior to deserialization, 
		// should not be called by users
		protected UICharacterSelect_Unit()
		{
			if (this.m_FloatTweenRunner == null)
				this.m_FloatTweenRunner = new TweenRunner<FloatTween>();
			
			this.m_FloatTweenRunner.Init(this);
		}
Example #3
0
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected Test_Fill()
        {
            if (this.m_FloatTweenRunner == null)
                this.m_FloatTweenRunner = new TweenRunner<FloatTween>();

            this.m_FloatTweenRunner.Init(this);
        }
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected UITab()
        {
            if (this.m_ColorTweenRunner == null)
                this.m_ColorTweenRunner = new TweenRunner<ColorTween>();

            this.m_ColorTweenRunner.Init(this);
        }
Example #5
0
 // Called by Unity prior to deserialization,
 // should not be called by users
 protected Graphic()
 {
     if (m_ColorTweenRunner == null)
         m_ColorTweenRunner = new TweenRunner<ColorTween>();
     m_ColorTweenRunner.Init(this);
     useLegacyMeshGeneration = true;
 }
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected Test_UIProgressBar()
        {
            if (this.m_FloatTweenRunner == null)
                this.m_FloatTweenRunner = new TweenRunner<FloatTween>();

            this.m_FloatTweenRunner.Init(this);
        }
		// Called by Unity prior to deserialization, 
		// should not be called by users
		protected Test_UIUnitFrame_Bar()
		{
			if (this.m_FloatTweenRunner == null)
				this.m_FloatTweenRunner = new TweenRunner<FloatTween>();
			
			this.m_FloatTweenRunner.Init(this);
		}
		// Called by Unity prior to deserialization, 
		// should not be called by users
		protected UILoadingBar_OverlayFinish()
		{
			if (this.m_FloatTweenRunner == null)
				this.m_FloatTweenRunner = new TweenRunner<FloatTween>();
			
			this.m_FloatTweenRunner.Init(this);
		}
Example #9
0
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected UIDurabilityTooltip()
        {
            if (this.m_FloatTweenRunner == null)
                this.m_FloatTweenRunner = new TweenRunner<FloatTween>();

            this.m_FloatTweenRunner.Init(this);
        }
Example #10
0
    public void FadeIn()
    {
        tween?.Kill();
        var fadeLevel = mat.GetFloat(FadeLevel);

        tween = Tween.Float(fadeLevel, 0f, duration, n => mat.SetFloat(FadeLevel, n));
    }
Example #11
0
		// Called by Unity prior to deserialization, 
		// should not be called by users
		protected UICastBar()
		{
			if (this.m_FloatTweenRunner == null)
				this.m_FloatTweenRunner = new TweenRunner<FloatTween>();
			
			this.m_FloatTweenRunner.Init(this);
		}
		protected AccordionElement()
		{
			if (this.m_FloatTweenRunner == null)
				this.m_FloatTweenRunner = new TweenRunner<FloatTween>();
			
			this.m_FloatTweenRunner.Init(this);
		}
Example #13
0
    public void RegisterTweenValueType()
    {
        var runner = new TweenRunner();

        // Register a test type
        TweenDataRegistry.RegisterTweenDataType <TestType>(GetValueTestType);

        // Make sure a tween of that type can be started and updated
        var startValue  = (TestType)1f;
        var tweenParams = new TweenParams
        {
            TweenSecs = 10f,
            Ease      = EaseType.Linear,
            Loop      = LoopType.PingPong
        };
        var tweenRef = runner.StartTween <TestType>(
            startValue,
            10f,
            tweenParams,
            null
            );

        // Make sure the starting value is correct
        var value = runner.GetTweenValue <TestType>(tweenRef);

        Assert.IsTrue(value == startValue, $"TestType pre update, got value {value} should be {startValue}");

        runner.Update(1f / 60f);

        // Make sure the value has changed after updating
        value = runner.GetTweenValue <TestType>(tweenRef);
        Assert.IsTrue(value != startValue, $"TestType post update, got value {value} should be different from start value {startValue}");

        runner.StopTween(tweenRef);
    }
 protected AccordionElement()
 {
     if (m_FloatTweenRunner == null)
     {
         m_FloatTweenRunner = new TweenRunner <FloatTween>();
     }
     m_FloatTweenRunner.Init(this);
 }
Example #15
0
 protected Graphic()
 {
     if (this.m_ColorTweenRunner == null)
     {
         this.m_ColorTweenRunner = new TweenRunner<ColorTween>();
     }
     this.m_ColorTweenRunner.Init(this);
 }
Example #16
0
    public void FadeOut()
    {
        tween?.Kill();
        mat.SetColor("_Color", color);
        var fadeLevel = mat.GetFloat(FadeLevel);

        tween = Tween.Float(fadeLevel, 1f, duration, n => mat.SetFloat(FadeLevel, n));
    }
 private void Awake()
 {
     _floatTweenRunner = new TweenRunner<FloatTween>();
     _floatTweenRunner.Init(this);
     _canvasGroup = GetComponent<CanvasGroup>();
     // Ensure it starts faded out
     _canvasGroup.alpha = 0f;
 }
Example #18
0
 protected UIImage()
 {
     if (m_ColorTweenRunner == null)
     {
         m_ColorTweenRunner = new TweenRunner <ColorTween>();
     }
     m_ColorTweenRunner.Init(this);
 }
Example #19
0
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected UILoadingOverlay()
        {
            if (this.m_FloatTweenRunner == null)
            {
                this.m_FloatTweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_FloatTweenRunner.Init(this);
        }
Example #20
0
        protected Test_CompassTester()
        {
            if (this.m_FloatTweenRunner == null)
            {
                this.m_FloatTweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_FloatTweenRunner.Init(this);
        }
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected Demo_CharacterSelectSlot()
        {
            if (this.m_TweenRunner == null)
            {
                this.m_TweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_TweenRunner.Init(this);
        }
Example #22
0
    // Called by Unity prior to deserialization,
    // should not be called by users
    ProgressBarController()
    {
        if (m_FloatTweenRunner == null)
        {
            m_FloatTweenRunner = new TweenRunner <FloatTween>();
        }

        m_FloatTweenRunner.Init(this);
    }
Example #23
0
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected UICastBar()
        {
            if (this.m_FloatTweenRunner == null)
            {
                this.m_FloatTweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_FloatTweenRunner.Init(this);
        }
Example #24
0
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected DemoArrow()
        {
            if (this.m_FloatTweenRunner == null)
            {
                this.m_FloatTweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_FloatTweenRunner.Init(this);
        }
Example #25
0
    public LevelWindow()
    {
        if (this.m_FloatTweenRunner == null)
        {
            this.m_FloatTweenRunner = new TweenRunner <FloatTween>();
        }

        this.m_FloatTweenRunner.Init(this);
    }
        protected HoverMove()
        {
            if (Runner == null)
            {
                Runner = new TweenRunner <FloatTween>();
            }

            Runner.Init(this);
        }
Example #27
0
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected UISelectField()
        {
            if (this.m_FloatTweenRunner == null)
            {
                this.m_FloatTweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_FloatTweenRunner.Init(this);
        }
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected Test_UIUnitFrame_Bar()
        {
            if (this.m_FloatTweenRunner == null)
            {
                this.m_FloatTweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_FloatTweenRunner.Init(this);
        }
Example #29
0
        protected UICollapsible()
        {
            if (this.m_FloatTweenRunner == null)
            {
                this.m_FloatTweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_FloatTweenRunner.Init(this);
        }
Example #30
0
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected Demo_FindMatch_Info()
        {
            if (this.m_TweenRunner == null)
            {
                this.m_TweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_TweenRunner.Init(this);
        }
Example #31
0
 // Called by Unity prior to deserialization,
 // should not be called by users
 protected Graphic()
 {
     if (m_ColorTweenRunner == null)
     {
         m_ColorTweenRunner = new TweenRunner <ColorTween>();
     }
     m_ColorTweenRunner.Init(this);
     useLegacyMeshGeneration = true;
 }
Example #32
0
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected UITab()
        {
            if (this.m_ColorTweenRunner == null)
            {
                this.m_ColorTweenRunner = new TweenRunner <ColorTween>();
            }

            this.m_ColorTweenRunner.Init(this);
        }
Example #33
0
        protected FadeMaterial()
        {
            if (Runner == null)
            {
                Runner = new TweenRunner <FloatTween>();
            }

            Runner.Init(this);
        }
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected UIEffectTransition()
        {
            if (this.m_ColorTweenRunner == null)
            {
                this.m_ColorTweenRunner = new TweenRunner <ColorTween>();
            }

            this.m_ColorTweenRunner.Init(this);
        }
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected UITooltip()
        {
            if (this.m_FloatTweenRunner == null)
            {
                this.m_FloatTweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_FloatTweenRunner.Init(this);
        }
Example #36
0
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected Test_UIProgressBar()
        {
            if (this.m_FloatTweenRunner == null)
            {
                this.m_FloatTweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_FloatTweenRunner.Init(this);
        }
Example #37
0
        protected Test_FadeInOut()
        {
            if (this.m_FloatTweenRunner == null)
            {
                this.m_FloatTweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_FloatTweenRunner.Init(this);
        }
Example #38
0
    protected virtual void Awake()
    {
        m_FloatTweenRunner = new TweenRunner <FloatTween>();
        m_FloatTweenRunner.Init(this);

        m_ColorTweenRunner = new TweenRunner <ColorTween>();
        m_ColorTweenRunner.Init(this);

        m_VectorTweenRunner = new TweenRunner <VectorTween>();
        m_VectorTweenRunner.Init(this);
    }
Example #39
0
 private static TweenRunner GetOrCacheTweenRunner()
 {
     if (tweenRunner == null)
     {
         var runnerGameObject = new GameObject("TweenRunner");
         runnerGameObject.hideFlags = HideFlags.HideAndDontSave;
         UnityEngine.Object.DontDestroyOnLoad(runnerGameObject);
         tweenRunner = runnerGameObject.AddComponent <TweenRunner> ();
     }
     return(tweenRunner);
 }
Example #40
0
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected UIToggleActiveTransition()
        {
            if (this.m_ColorTweenRunner == null)
            {
                this.m_ColorTweenRunner = new TweenRunner <ColorTween>();
            }

            if (this.m_FloatTweenRunner == null)
            {
                this.m_FloatTweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_ColorTweenRunner.Init(this);
            this.m_FloatTweenRunner.Init(this);
        }
        // Called by Unity prior to deserialization,
        // should not be called by users
        protected UIHighlightTransition()
        {
            if (this.m_ColorTweenRunner == null)
            {
                this.m_ColorTweenRunner = new TweenRunner <ColorTween>();
            }

            if (this.m_FloatTweenRunner == null)
            {
                this.m_FloatTweenRunner = new TweenRunner <FloatTween>();
            }

            this.m_ColorTweenRunner.Init(this);
            this.m_FloatTweenRunner.Init(this);
        }
Example #42
0
    public void CrossFadeFloat(TweenRunner <FloatTween> tweenRunner, float duration, float start, float end, UnityAction <float> callback, UnityAction endCallback)
    {
        var floatTween = new FloatTween {
            duration = duration, startValue = start, targetValue = end
        };

        floatTween.AddOnChangedCallback(callback);
        if (endCallback != null)
        {
            floatTween.AddOnEndCallback(endCallback);
        }

        floatTween.ignoreTimeScale = true;
        tweenRunner.StartTween(floatTween);
    }
Example #43
0
 protected Graphic()
 {
   if (this.m_ColorTweenRunner == null)
     this.m_ColorTweenRunner = new TweenRunner<ColorTween>();
   this.m_ColorTweenRunner.Init((MonoBehaviour) this);
   this.useLegacyMeshGeneration = true;
 }