Ejemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        GUILayout.Space(6f);
        BCEditorTools.SetLabelWidth(120f);

        BCTweenColor tw = target as BCTweenColor;

        GUI.changed = false;

        Color from = EditorGUILayout.ColorField("From", tw.from);
        Color to   = EditorGUILayout.ColorField("To", tw.to);

        tw.UGUIMode = EditorGUILayout.Toggle("UGUI Mode", tw.UGUIMode);
        if (tw.UGUIMode)
        {
            DrawDefaultInspector();
        }

        if (GUI.changed)
        {
            BCEditorTools.RegisterUndo("Tween Change", tw);
            tw.from = from;
            tw.to   = to;
            BCEditorTools.SetDirty(tw);
        }

        DrawCommonProperties();
    }
Ejemplo n.º 2
0
 static int SetCurrentValueToEnd(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         BCTweenColor obj = (BCTweenColor)ToLua.CheckObject <BCTweenColor>(L, 1);
         obj.SetCurrentValueToEnd();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 3
0
    static int set_uguiModeRenders(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            BCTweenColor           obj  = (BCTweenColor)o;
            UnityEngine.Renderer[] arg0 = ToLua.CheckObjectArray <UnityEngine.Renderer>(L, 2);
            obj.uguiModeRenders = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index uguiModeRenders on a nil value"));
        }
    }
Ejemplo n.º 4
0
    static int set_value(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            BCTweenColor      obj  = (BCTweenColor)o;
            UnityEngine.Color arg0 = ToLua.ToColor(L, 2);
            obj.value = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index value on a nil value"));
        }
    }
Ejemplo n.º 5
0
    static int set_UGUIMode(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            BCTweenColor obj  = (BCTweenColor)o;
            bool         arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.UGUIMode = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index UGUIMode on a nil value"));
        }
    }
Ejemplo n.º 6
0
 static int Begin(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
         float             arg1      = (float)LuaDLL.luaL_checknumber(L, 2);
         UnityEngine.Color arg2      = ToLua.ToColor(L, 3);
         BCTweenColor      o         = BCTweenColor.Begin(arg0, arg1, arg2);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 7
0
    static int get_value(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            BCTweenColor      obj = (BCTweenColor)o;
            UnityEngine.Color ret = obj.value;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index value on a nil value"));
        }
    }
Ejemplo n.º 8
0
    static int get_uguiModeRenders(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            BCTweenColor           obj = (BCTweenColor)o;
            UnityEngine.Renderer[] ret = obj.uguiModeRenders;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index uguiModeRenders on a nil value"));
        }
    }
Ejemplo n.º 9
0
    static int get_UGUIMode(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            BCTweenColor obj = (BCTweenColor)o;
            bool         ret = obj.UGUIMode;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index UGUIMode on a nil value"));
        }
    }
Ejemplo n.º 10
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public BCTweenColor Begin(GameObject go, float duration, Color color)
    {
#if UNITY_EDITOR
        if (!Application.isPlaying)
        {
            return(null);
        }
#endif
        BCTweenColor comp = BCUITweener.Begin <BCTweenColor>(go, duration);
        comp.from = comp.value;
        comp.to   = color;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }