示例#1
0
        public static BETween add(GameObject go, float _duration, BETweenType type)
        {
            // when creation, this script not attached to target,
            // instead, create gameobject named "BETween" and attach to this gameobject.
            // in this method, tween work well even target object is not active.
            GameObject goBase = GameObject.Find("BETween");

            if (goBase == null)
            {
                goBase = new GameObject("BETween");
            }

            BETween newTween = goBase.AddComponent <BETween>();

            newTween.goTarget    = go;
            newTween.tr          = go.transform;
            newTween.rt          = go.GetComponent <RectTransform>();
            newTween.canvasGroup = go.GetComponent <CanvasGroup>();
            newTween.image       = go.GetComponent <Image>();
            newTween.meshRender  = go.GetComponent <MeshRenderer>();
            newTween.duration    = _duration;
            newTween.type        = type;

            return(newTween);
        }
示例#2
0
    static int set_type(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            BETween     obj  = (BETween)o;
            BETweenType arg0 = (BETweenType)ToLua.CheckObject(L, 2, typeof(BETweenType));
            obj.type = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index type on a nil value" : e.Message));
        }
    }
示例#3
0
    static int get_type(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            BETween     obj = (BETween)o;
            BETweenType ret = obj.type;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index type on a nil value" : e.Message));
        }
    }
示例#4
0
 static int add(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 1, typeof(UnityEngine.GameObject));
         float       arg1            = (float)LuaDLL.luaL_checknumber(L, 2);
         BETweenType arg2            = (BETweenType)ToLua.CheckObject(L, 3, typeof(BETweenType));
         BETween     o = BETween.add(arg0, arg1, arg2);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#5
0
 public void SetType(int ntype)
 {
     type = (BETweenType)ntype;
 }