Example #1
0
		public override void OnEnter()
		{
			GameObject _go = Fsm.GetOwnerDefaultTarget(gameObject);
			if (_go!=null)
			{
				_graphic = _go.GetComponent<UnityEngine.UI.Graphic>();
			}

			if(!rebuildOnExit)
			{
				DoAction();
			}

			Finish();
		}
		public override void OnEnter()
		{
			
			GameObject _go = Fsm.GetOwnerDefaultTarget(gameObject);
			if (_go!=null)
			{
				_component = _go.GetComponent<UnityEngine.UI.Graphic>();
			}

			DoGetColorValue();

			if (!everyFrame)
			{
				Finish();
			}
		}
		public override void OnEnter()
		{

			GameObject _go = Fsm.GetOwnerDefaultTarget(gameObject);
			if (_go!=null)
			{
				_inputField = _go.GetComponent<UnityEngine.UI.InputField>();
			}

			if (resetOnExit.Value)
			{
				_originalValue = _inputField.placeholder;
			}

			DoSetValue();
			
			Finish();
		}
		public void FindUIElements() {
			// Only find if none of the critical UI elements are assigned:
			if (mainGraphic == null && nameText == null && reticleInRange == null) {
				var elements = FindObjectOfType<UnityUISelectorElements>();
				if (elements == null) {
					if (DialogueDebug.LogWarnings) Debug.LogWarning("Dialogue System: UnityUISelectorDisplay can't find UI elements", this);
				} else {
					if (mainGraphic == null) mainGraphic = elements.mainGraphic;
					if (nameText == null) nameText = elements.nameText;
					if (useMessageText == null) useMessageText = elements.useMessageText;
					inRangeColor = elements.inRangeColor;
					outOfRangeColor = elements.outOfRangeColor;
					if (reticleInRange == null) reticleInRange = elements.reticleInRange;
					if (reticleOutOfRange == null) reticleOutOfRange = elements.reticleOutOfRange;
					animationTransitions = elements.animationTransitions;
				}
			}
			if (mainGraphic != null) animator = GetComponentInChildren<Animator>();
		}
        static int _m_GetPixelAdjustedRect(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.UI.Graphic __cl_gen_to_be_invoked = (UnityEngine.UI.Graphic)translator.FastGetCSObj(L, 1);


            try {
                {
                    UnityEngine.Rect __cl_gen_ret = __cl_gen_to_be_invoked.GetPixelAdjustedRect(  );
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static int _m_SetAllDirty(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.UI.Graphic gen_to_be_invoked = (UnityEngine.UI.Graphic)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.SetAllDirty(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Example #7
0
 private IEnumerator DisableAfterAnimation(UnityEngine.UI.Graphic panel)
 {
     if (animator != null)
     {
         const float maxWaitDuration = 10;
         float       timeout         = Time.realtimeSinceStartup + maxWaitDuration;
         var         oldHashId       = UITools.GetAnimatorNameHash(animator.GetCurrentAnimatorStateInfo(0));
         while ((UITools.GetAnimatorNameHash(animator.GetCurrentAnimatorStateInfo(0)) == oldHashId) && (Time.realtimeSinceStartup < timeout))
         {
             yield return(null);
         }
         yield return(new WaitForSeconds(animator.GetCurrentAnimatorStateInfo(0).length));
     }
                 #if !UNITY_WEBPLAYER
     base.SetActive(false);             // Can't call base virtual methods in webplayer.
                 #endif
     if (panel != null)
     {
         Tools.SetGameObjectActive(panel, false);
     }
 }
        static int _m_RegisterGraphicForCanvas_xlua_st_(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



            try {
                {
                    UnityEngine.Canvas     c       = (UnityEngine.Canvas)translator.GetObject(L, 1, typeof(UnityEngine.Canvas));
                    UnityEngine.UI.Graphic graphic = (UnityEngine.UI.Graphic)translator.GetObject(L, 2, typeof(UnityEngine.UI.Graphic));

                    UnityEngine.UI.GraphicRegistry.RegisterGraphicForCanvas(c, graphic);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        public override void OnEnter()
        {
            GameObject _go = Fsm.GetOwnerDefaultTarget(gameObject);

            if (_go != null)
            {
                _component = _go.GetComponent <UnityEngine.UI.Graphic>();
            }

            if (resetOnExit.Value)
            {
                _originalColor = _component.color;
            }

            DoSetColorValue();

            if (!everyFrame)
            {
                Finish();
            }
        }
        static int _m_Rebuild(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.UI.Graphic __cl_gen_to_be_invoked = (UnityEngine.UI.Graphic)translator.FastGetCSObj(L, 1);


            try {
                {
                    UnityEngine.UI.CanvasUpdate update; translator.Get(L, 2, out update);

                    __cl_gen_to_be_invoked.Rebuild(update);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static int _m_UnregisterDirtyMaterialCallback(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.UI.Graphic __cl_gen_to_be_invoked = (UnityEngine.UI.Graphic)translator.FastGetCSObj(L, 1);


            try {
                {
                    UnityEngine.Events.UnityAction action = translator.GetDelegate <UnityEngine.Events.UnityAction>(L, 2);

                    __cl_gen_to_be_invoked.UnregisterDirtyMaterialCallback(action);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static StackObject *CrossFadeAlpha_28(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Boolean @ignoreTimeScale = ptr_of_this_method->Value == 1;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Single @duration = *(float *)&ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            System.Single @alpha = *(float *)&ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            UnityEngine.UI.Graphic instance_of_this_method = (UnityEngine.UI.Graphic) typeof(UnityEngine.UI.Graphic).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.CrossFadeAlpha(@alpha, @duration, @ignoreTimeScale);

            return(__ret);
        }
        static int _m_RegisterDirtyVerticesCallback(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.UI.Graphic gen_to_be_invoked = (UnityEngine.UI.Graphic)translator.FastGetCSObj(L, 1);



                {
                    UnityEngine.Events.UnityAction _action = translator.GetDelegate <UnityEngine.Events.UnityAction>(L, 2);

                    gen_to_be_invoked.RegisterDirtyVerticesCallback(_action);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Example #14
0
        public override void OnEnter()
        {
            GameObject _go = Fsm.GetOwnerDefaultTarget(gameObject);

            if (_go != null)
            {
                _component = _go.GetComponent <UnityEngine.UI.Graphic>();
            }

            Color _color = _component.color;

            if (!color.IsNone)
            {
                _color = color.Value;
            }

            if (!red.IsNone)
            {
                _color.r = red.Value;
            }
            if (!green.IsNone)
            {
                _color.g = green.Value;
            }
            if (!blue.IsNone)
            {
                _color.b = blue.Value;
            }
            if (!alpha.IsNone)
            {
                _color.a = alpha.Value;
            }

            _component.CrossFadeColor(_color, duration.Value, ignoredTimeScale.Value, useAlpha.Value);

            Finish();
        }
        static StackObject *Raycast_23(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Camera @eventCamera = (UnityEngine.Camera) typeof(UnityEngine.Camera).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Vector2 @sp = (UnityEngine.Vector2) typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityEngine.UI.Graphic instance_of_this_method = (UnityEngine.UI.Graphic) typeof(UnityEngine.UI.Graphic).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Raycast(@sp, @eventCamera);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
        static int _m_Raycast(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.UI.Graphic __cl_gen_to_be_invoked = (UnityEngine.UI.Graphic)translator.FastGetCSObj(L, 1);


            try {
                {
                    UnityEngine.Vector2 sp; translator.Get(L, 2, out sp);
                    UnityEngine.Camera  eventCamera = (UnityEngine.Camera)translator.GetObject(L, 3, typeof(UnityEngine.Camera));

                    bool __cl_gen_ret = __cl_gen_to_be_invoked.Raycast(sp, eventCamera);
                    LuaAPI.lua_pushboolean(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static int _m_CrossFadeAlpha(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.UI.Graphic __cl_gen_to_be_invoked = (UnityEngine.UI.Graphic)translator.FastGetCSObj(L, 1);


            try {
                {
                    float alpha           = (float)LuaAPI.lua_tonumber(L, 2);
                    float duration        = (float)LuaAPI.lua_tonumber(L, 3);
                    bool  ignoreTimeScale = LuaAPI.lua_toboolean(L, 4);

                    __cl_gen_to_be_invoked.CrossFadeAlpha(alpha, duration, ignoreTimeScale);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Example #18
0
        public static void SetPictureOrLoadColor(Image image, UnityEngine.UI.Graphic graph)
        {
            if (image.arguments != null && image.arguments.Length > 0)
            {
                if (image.arguments.Length > 0)
                {
                    Debug.Log(image.arguments[0]);
                    Color color;
                    if (ColorUtility.TryParseHtmlString(image.arguments[0], out color))
                    {
                        graph.color = color;
                    }
                }
            }
            else
            {
                string assetPath = PSDImportUtility.GetPicturePath(image);

                Object sprite = UnityEditor.AssetDatabase.LoadAssetAtPath(assetPath, typeof(Sprite));
                if (sprite != null)
                {
                    if (graph is UnityEngine.UI.Image)
                    {
                        ((UnityEngine.UI.Image)graph).sprite = sprite as Sprite;
                    }
                    else if (graph is UnityEngine.UI.RawImage)
                    {
                        ((UnityEngine.UI.RawImage)graph).texture = sprite as Texture;
                    }
                }
                else
                {
                    Debug.Log("loading asset at path: " + assetPath + "\nname:" + image.name);
                }
            }
        }
        static int _m_PixelAdjustPoint(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.UI.Graphic gen_to_be_invoked = (UnityEngine.UI.Graphic)translator.FastGetCSObj(L, 1);



                {
                    UnityEngine.Vector2 _point; translator.Get(L, 2, out _point);

                    var gen_ret = gen_to_be_invoked.PixelAdjustPoint(_point);
                    translator.PushUnityEngineVector2(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
 /// <summary>Tweens an Graphic's alpha color to the given value.
 /// Also stores the image as the tween's target so it can be used for filtered operations</summary>
 /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
 public static Tweener DOFade(this UnityEngine.UI.Graphic target, float endValue, float duration)
 {
     return(DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
            .SetTarget(target));
 }
Example #21
0
 public static TARGET colorTransition(this TARGET target, UnityEngine.Color value, float duration, LeanEase ease = LeanEase.Smooth)
 {
     Method.LeanGraphicColor.Register(target, value, duration, ease); return(target);
 }
 public CoroutineGraphicColor(UnityEngine.UI.Graphic graphic, Color from, Color to)
 {
     _graphic = graphic;
     From     = from;
     To       = to;
 }
Example #23
0
 public static GraphicColorTween TweenGraphicColor(this UnityEngine.UI.Graphic graphics,
                                                   Color color, float time, float delay = 0, Func <double, double> easing = null,
                                                   Action callback = null) => TweenHandling.Tween <UnityEngine.UI.Graphic, Color, GraphicColorTween>
     (graphics, color, time, delay, easing, callback);
Example #24
0
 public static void startBezierAnimation(UnityEngine.UI.Graphic gfx, RectTransform target, RectTransform tf0, RectTransform tf1, float dur, System.Action cb = null, Tween.TweenTypes tweenType = Tween.TweenTypes.easeInOutSine)
 {
     gfx.gameObject.AddComponent <UITween> ().StartBezierAnimation(target, tf0, tf1, dur, cb, tweenType);
 }
Example #25
0
        public static void startScaleAnimation(UnityEngine.UI.Graphic gfx, float scale0, float scale1, float dur, float wait, Tween.TweenTypes tweenTypes, System.Action cb = null)
        {
            var rt = gfx.gameObject.GetComponent <RectTransform> ();

            rt.gameObject.AddComponent <UITween> ().StartScaleAnimation(scale0, scale1, dur, wait, tweenTypes, cb);
        }
Example #26
0
 public static void StartAnimateValue(UnityEngine.UI.Graphic gfx, float v0, float v1, float dur, float wait, Tween.TweenTypes tweenType, System.Action onBegin, System.Action <float> onUpdate, System.Action onEnd)
 {
     gfx.gameObject.AddComponent <UITween> ()._StartAnimateValue(v0, v1, dur, wait, tweenType, onBegin, onUpdate, onEnd);
 }
Example #27
0
 public static void startAlphaAnimation(UnityEngine.UI.Graphic gfx, float v0, float v1, float dur, float wait, Tween.TweenTypes tweenTypes, System.Action cb = null)
 {
     gfx.gameObject.AddComponent <UITween> ().StartAlphaAnimation(v0, v1, dur, wait, tweenTypes, cb);
 }
Example #28
0
 /// <summary>
 /// Grab the graphic when the colour is taken.
 /// </summary>
 protected override void Reset()
 {
     this.tweenGraphic = this.GetComponent <UnityEngine.UI.Graphic>();
     base.Reset();
 }
Example #29
0
 /** マテリアルを設定する。
  */
 public void SetMaterialToInstance(UnityEngine.UI.Graphic a_instance)
 {
     a_instance.material = this.material;
 }
Example #30
0
        public override void ValidateEditor()
        {
            base.ValidateEditor();

            this.graphics = this.GetComponent <Graphic>();
        }
Example #31
0
 public void ApplyG(UnityEngine.UI.Graphic graphic)
 {
     graphic.color = this.color;
 }