Inheritance: UIWidgetContainer
    static int get_duration(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIButtonColor obj = (UIButtonColor)o;
            float         ret = obj.duration;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index duration on a nil value" : e.Message));
        }
    }
    static int get_state(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIButtonColor       obj = (UIButtonColor)o;
            UIButtonColor.State ret = obj.state;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index state on a nil value" : e.Message));
        }
    }
    static int set_tweenTarget(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIButtonColor          obj  = (UIButtonColor)o;
            UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.GameObject));
            obj.tweenTarget = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index tweenTarget on a nil value" : e.Message));
        }
    }
    static int get_isEnabled(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIButtonColor obj = (UIButtonColor)o;
            bool          ret = obj.isEnabled;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index isEnabled on a nil value" : e.Message));
        }
    }
Beispiel #5
0
    static int set_isEnabled(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIButtonColor obj  = (UIButtonColor)o;
            bool          arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.isEnabled = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index isEnabled on a nil value" : e.Message));
        }
    }
    static int set_disabledColor(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIButtonColor     obj  = (UIButtonColor)o;
            UnityEngine.Color arg0 = ToLua.ToColor(L, 2);
            obj.disabledColor = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index disabledColor on a nil value" : e.Message));
        }
    }
    static int set_duration(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIButtonColor obj  = (UIButtonColor)o;
            float         arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.duration = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index duration on a nil value" : e.Message));
        }
    }
    static int get_defaultColor(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIButtonColor     obj = (UIButtonColor)o;
            UnityEngine.Color ret = obj.defaultColor;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index defaultColor on a nil value" : e.Message));
        }
    }
    static int set_state(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIButtonColor       obj  = (UIButtonColor)o;
            UIButtonColor.State arg0 = (UIButtonColor.State)ToLua.CheckObject(L, 2, typeof(UIButtonColor.State));
            obj.state = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index state on a nil value" : e.Message));
        }
    }
Beispiel #10
0
 protected virtual void StartDragging()
 {
     if (!interactable || mDragging)
     {
         return;
     }
     if (cloneOnDrag)
     {
         mPressed = false;
         GameObject gameObject = NGUITools.AddChild(base.transform.parent.gameObject, base.gameObject);
         gameObject.transform.localPosition = base.transform.localPosition;
         gameObject.transform.localRotation = base.transform.localRotation;
         gameObject.transform.localScale    = base.transform.localScale;
         UIButtonColor component = gameObject.GetComponent <UIButtonColor>();
         if (component != null)
         {
             component.defaultColor = GetComponent <UIButtonColor>().defaultColor;
         }
         if (mTouch != null && mTouch.pressed == base.gameObject)
         {
             mTouch.current = gameObject;
             mTouch.pressed = gameObject;
             mTouch.dragged = gameObject;
             mTouch.last    = gameObject;
         }
         UIDragDropItem component2 = gameObject.GetComponent <UIDragDropItem>();
         component2.mTouch    = mTouch;
         component2.mPressed  = true;
         component2.mDragging = true;
         component2.Start();
         component2.OnDragDropStart();
         if (UICamera.currentTouch == null)
         {
             UICamera.currentTouch = mTouch;
         }
         mTouch = null;
         UICamera.Notify(base.gameObject, "OnPress", false);
         UICamera.Notify(base.gameObject, "OnHover", false);
     }
     else
     {
         mDragging = true;
         OnDragDropStart();
     }
 }
Beispiel #11
0
    private void CreateVoiceLink()
    {
        Transform voiceTrans = transform.FindChild("voiceobj");

        if (voiceTrans != null)
        {
            UIDragScrollView dragScrollview = UtilTools.SafeAddComponent <UIDragScrollView>(mWidget.gameObject);
            BoxCollider      boxcollider    = UtilTools.SafeAddComponent <BoxCollider>(mWidget.gameObject);
            boxcollider.size   = new Vector3(mWidget.width, mWidget.height, 0);
            boxcollider.center = new Vector3(mWidget.width * 0.5f, -mWidget.height * 0.5f, 0);
            UIButtonColor btnColor = UtilTools.SafeAddComponent <UIButtonColor>(mWidget.gameObject);
            btnColor.duration = 0.1f;
            UILinkText linkText = UtilTools.SafeAddComponent <UILinkText>(mWidget.gameObject);
            linkText.args        = voice_args;
            linkText.linktype    = LinkType.AUDIO;
            linkText.voiceObject = voiceTrans.gameObject;
        }
    }
Beispiel #12
0
	/// <summary>
	/// Start the dragging operation.
	/// </summary>

	void OnDragStart ()
	{
		if (!enabled || mTouchID != int.MinValue) return;

		// If we have a restriction, check to see if its condition has been met first
		if (restriction != Restriction.None)
		{
			if (restriction == Restriction.Horizontal)
			{
				Vector2 delta = UICamera.currentTouch.totalDelta;
				if (Mathf.Abs(delta.x) < Mathf.Abs(delta.y)) return;
			}
			else if (restriction == Restriction.Vertical)
			{
				Vector2 delta = UICamera.currentTouch.totalDelta;
				if (Mathf.Abs(delta.x) > Mathf.Abs(delta.y)) return;
			}
			else if (restriction == Restriction.PressAndHold)
			{
				if (mPressTime + 1f > RealTime.time) return;
			}
		}

		if (cloneOnDrag)
		{
			GameObject clone = NGUITools.AddChild(transform.parent.gameObject, gameObject);
			clone.transform.localPosition = transform.localPosition;
			clone.transform.localRotation = transform.localRotation;
			clone.transform.localScale = transform.localScale;

			UIButtonColor bc = clone.GetComponent<UIButtonColor>();
			if (bc != null) bc.defaultColor = GetComponent<UIButtonColor>().defaultColor;

			UICamera.Notify(UICamera.currentTouch.pressed, "OnPress", false);

			UICamera.currentTouch.pressed = clone;
			UICamera.currentTouch.dragged = clone;

			UIDragDropItem item = clone.GetComponent<UIDragDropItem>();
			item.Start();
			item.OnDragDropStart();
		}
		else OnDragDropStart();
	}
Beispiel #13
0
    public static int set_isEnabled(IntPtr l)
    {
        int result;

        try
        {
            UIButtonColor uIButtonColor = (UIButtonColor)LuaObject.checkSelf(l);
            bool          isEnabled;
            LuaObject.checkType(l, 2, out isEnabled);
            uIButtonColor.isEnabled = isEnabled;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Beispiel #14
0
    public static int set_state(IntPtr l)
    {
        int result;

        try
        {
            UIButtonColor       uIButtonColor = (UIButtonColor)LuaObject.checkSelf(l);
            UIButtonColor.State state;
            LuaObject.checkEnum <UIButtonColor.State>(l, 2, out state);
            uIButtonColor.state = state;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Beispiel #15
0
    public static int set_defaultColor(IntPtr l)
    {
        int result;

        try
        {
            UIButtonColor uIButtonColor = (UIButtonColor)LuaObject.checkSelf(l);
            Color         defaultColor;
            LuaObject.checkType(l, 2, out defaultColor);
            uIButtonColor.defaultColor = defaultColor;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Beispiel #16
0
    public static int set_changeStateSprite(IntPtr l)
    {
        int result;

        try
        {
            UIButtonColor uIButtonColor = (UIButtonColor)LuaObject.checkSelf(l);
            bool          changeStateSprite;
            LuaObject.checkType(l, 2, out changeStateSprite);
            uIButtonColor.changeStateSprite = changeStateSprite;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Beispiel #17
0
    public static int set_tweenTarget(IntPtr l)
    {
        int result;

        try
        {
            UIButtonColor uIButtonColor = (UIButtonColor)LuaObject.checkSelf(l);
            GameObject    tweenTarget;
            LuaObject.checkType <GameObject>(l, 2, out tweenTarget);
            uIButtonColor.tweenTarget = tweenTarget;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Beispiel #18
0
    private static int set_duration(IntPtr L)
    {
        object        luaObject     = LuaScriptMgr.GetLuaObject(L, 1);
        UIButtonColor uIButtonColor = (UIButtonColor)luaObject;

        if (uIButtonColor == null)
        {
            LuaTypes luaTypes = LuaDLL.lua_type(L, 1);
            if (luaTypes == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name duration");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index duration on a nil value");
            }
        }
        uIButtonColor.duration = (float)LuaScriptMgr.GetNumber(L, 3);
        return(0);
    }
Beispiel #19
0
    private static int get_pressed(IntPtr L)
    {
        object        luaObject     = LuaScriptMgr.GetLuaObject(L, 1);
        UIButtonColor uIButtonColor = (UIButtonColor)luaObject;

        if (uIButtonColor == null)
        {
            LuaTypes luaTypes = LuaDLL.lua_type(L, 1);
            if (luaTypes == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name pressed");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index pressed on a nil value");
            }
        }
        LuaScriptMgr.Push(L, uIButtonColor.pressed);
        return(1);
    }
Beispiel #20
0
    private static int set_tweenTarget(IntPtr L)
    {
        object        luaObject     = LuaScriptMgr.GetLuaObject(L, 1);
        UIButtonColor uIButtonColor = (UIButtonColor)luaObject;

        if (uIButtonColor == null)
        {
            LuaTypes luaTypes = LuaDLL.lua_type(L, 1);
            if (luaTypes == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name tweenTarget");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index tweenTarget on a nil value");
            }
        }
        uIButtonColor.tweenTarget = (GameObject)LuaScriptMgr.GetUnityObject(L, 3, typeof(GameObject));
        return(0);
    }
Beispiel #21
0
    private static int set_state(IntPtr L)
    {
        object        luaObject     = LuaScriptMgr.GetLuaObject(L, 1);
        UIButtonColor uIButtonColor = (UIButtonColor)luaObject;

        if (uIButtonColor == null)
        {
            LuaTypes luaTypes = LuaDLL.lua_type(L, 1);
            if (luaTypes == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name state");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index state on a nil value");
            }
        }
        uIButtonColor.state = (UIButtonColor.State)((int)LuaScriptMgr.GetNetObject(L, 3, typeof(UIButtonColor.State)));
        return(0);
    }
Beispiel #22
0
    private static int set_isEnabled(IntPtr L)
    {
        object        luaObject     = LuaScriptMgr.GetLuaObject(L, 1);
        UIButtonColor uIButtonColor = (UIButtonColor)luaObject;

        if (uIButtonColor == null)
        {
            LuaTypes luaTypes = LuaDLL.lua_type(L, 1);
            if (luaTypes == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name isEnabled");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index isEnabled on a nil value");
            }
        }
        uIButtonColor.isEnabled = LuaScriptMgr.GetBoolean(L, 3);
        return(0);
    }
Beispiel #23
0
    public static int SetState(IntPtr l)
    {
        int result;

        try
        {
            UIButtonColor       uIButtonColor = (UIButtonColor)LuaObject.checkSelf(l);
            UIButtonColor.State state;
            LuaObject.checkEnum <UIButtonColor.State>(l, 2, out state);
            bool instant;
            LuaObject.checkType(l, 3, out instant);
            uIButtonColor.SetState(state, instant);
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Beispiel #24
0
 private IEnumerator VerifFinishCyc(UIButtonColor btn, UILabel label)
 {
     btn.isEnabled = false;
     if (label != null)
     {
         label.gameObject.SetActive(true);
         var waitOnce = new WaitForSeconds(1);
         var total    = VerificationCyc;
         while (total >= 0)
         {
             label.text = string.Format(VerifTimeFormat, total--);
             yield return(waitOnce);
         }
         label.gameObject.SetActive(false);
     }
     else
     {
         yield return(new WaitForSeconds(VerificationCyc));
     }
     btn.isEnabled = true;
 }
    protected void DrawColors()
    {
        if (serializedObject.FindProperty("tweenTarget").objectReferenceValue == null)
        {
            return;
        }

        if (NGUIEditorTools.DrawHeader("Colors", "Colors", false, true))
        {
            NGUIEditorTools.BeginContents(true);
            NGUIEditorTools.SetLabelWidth(76f);
            UIButtonColor btn = target as UIButtonColor;

            if (btn.tweenTarget != null)
            {
                UIWidget widget = btn.tweenTarget.GetComponent <UIWidget>();

                if (widget != null)
                {
                    EditorGUI.BeginDisabledGroup(serializedObject.isEditingMultipleObjects);
                    {
                        SerializedObject obj = new SerializedObject(widget);
                        obj.Update();
                        NGUIEditorTools.DrawProperty("Normal", obj, "mColor");
                        obj.ApplyModifiedProperties();
                    }
                    EditorGUI.EndDisabledGroup();
                }
            }

            NGUIEditorTools.DrawProperty("Hover", serializedObject, "hover");
            NGUIEditorTools.DrawProperty("Pressed", serializedObject, "pressed");
            NGUIEditorTools.DrawProperty("Disabled", serializedObject, "disabledColor");
            if (Application.isPlaying)
            {
                EditorGUILayout.ColorField("Default", (target as UIButtonColor).defaultColor);
            }
            NGUIEditorTools.EndContents();
        }
    }
    static int get_hover(IntPtr L)
    {
        object        o   = LuaScriptMgr.GetLuaObject(L, 1);
        UIButtonColor obj = (UIButtonColor)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name hover");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index hover on a nil value");
            }
        }

        LuaScriptMgr.Push(L, obj.hover);
        return(1);
    }
Beispiel #27
0
    public static float $Get3(object instance, int index)
    {
        UIButtonColor expr_06_cp_0 = (UIButtonColor)instance;

        switch (index)
        {
        case 0:
            return(expr_06_cp_0.disabledColor.r);

        case 1:
            return(expr_06_cp_0.disabledColor.g);

        case 2:
            return(expr_06_cp_0.disabledColor.b);

        case 3:
            return(expr_06_cp_0.disabledColor.a);

        default:
            throw new ArgumentOutOfRangeException("index");
        }
    }
    static int set_defaultColor(IntPtr L)
    {
        object        o   = LuaScriptMgr.GetLuaObject(L, 1);
        UIButtonColor obj = (UIButtonColor)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name defaultColor");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index defaultColor on a nil value");
            }
        }

        obj.defaultColor = LuaScriptMgr.GetColor(L, 3);
        return(0);
    }
    static int set_state(IntPtr L)
    {
        object        o   = LuaScriptMgr.GetLuaObject(L, 1);
        UIButtonColor obj = (UIButtonColor)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name state");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index state on a nil value");
            }
        }

        obj.state = (UIButtonColor.State)LuaScriptMgr.GetNetObject(L, 3, typeof(UIButtonColor.State));
        return(0);
    }
Beispiel #30
0
    static int set_changeStateSprite(IntPtr L)
    {
        object        o   = LuaScriptMgr.GetLuaObject(L, 1);
        UIButtonColor obj = (UIButtonColor)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name changeStateSprite");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index changeStateSprite on a nil value");
            }
        }

        obj.changeStateSprite = LuaScriptMgr.GetBoolean(L, 3);
        return(0);
    }
	void Awake(){
        charscript = GameObject.Find("CharSelect").GetComponent<CharSelectScript>();
		infoscript = PlayerServerInfo.Instance;
		buttcolor = GetComponent<UIButtonColor>();
	}
Beispiel #32
0
 public override void SetState(UIButtonColor.State state, bool immediate)
 {
     base.SetState(state, immediate);
     if (this.mSprite != null)
     {
         switch (state)
         {
         case UIButtonColor.State.Normal:
             this.SetSprite(this.mNormalSprite);
             break;
         case UIButtonColor.State.Hover:
             this.SetSprite((!string.IsNullOrEmpty(this.hoverSprite)) ? this.hoverSprite : this.mNormalSprite);
             break;
         case UIButtonColor.State.Pressed:
             this.SetSprite(this.pressedSprite);
             break;
         case UIButtonColor.State.Disabled:
             this.SetSprite(this.disabledSprite);
             break;
         }
     }
     else if (this.mSprite2D != null)
     {
         switch (state)
         {
         case UIButtonColor.State.Normal:
             this.SetSprite(this.mNormalSprite2D);
             break;
         case UIButtonColor.State.Hover:
             this.SetSprite((!(this.hoverSprite2D == null)) ? this.hoverSprite2D : this.mNormalSprite2D);
             break;
         case UIButtonColor.State.Pressed:
             this.SetSprite(this.pressedSprite2D);
             break;
         case UIButtonColor.State.Disabled:
             this.SetSprite(this.disabledSprite2D);
             break;
         }
     }
 }
Beispiel #33
0
 public virtual void SetState(UIButtonColor.State state, bool instant)
 {
     if (!this.mInitDone)
     {
         this.mInitDone = true;
         this.OnInit();
     }
     if (this.mState != state)
     {
         this.mState = state;
         this.UpdateColor(instant);
     }
 }