예제 #1
0
    static int PushMaterial(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                Nova.PostProcessing  obj  = (Nova.PostProcessing)ToLua.CheckObject <Nova.PostProcessing>(L, 1);
                UnityEngine.Material arg0 = (UnityEngine.Material)ToLua.CheckObject <UnityEngine.Material>(L, 2);
                obj.PushMaterial(arg0);
                return(0);
            }
            else if (count == 3)
            {
                Nova.PostProcessing obj = (Nova.PostProcessing)ToLua.CheckObject <Nova.PostProcessing>(L, 1);
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                UnityEngine.Material arg1 = (UnityEngine.Material)ToLua.CheckObject <UnityEngine.Material>(L, 3);
                obj.PushMaterial(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Nova.PostProcessing.PushMaterial"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
예제 #2
0
    static int ClearLayer(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                Nova.PostProcessing obj = (Nova.PostProcessing)ToLua.CheckObject <Nova.PostProcessing>(L, 1);
                obj.ClearLayer();
                return(0);
            }
            else if (count == 2)
            {
                Nova.PostProcessing obj = (Nova.PostProcessing)ToLua.CheckObject <Nova.PostProcessing>(L, 1);
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                obj.ClearLayer(arg0);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Nova.PostProcessing.ClearLayer"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
예제 #3
0
        private void Awake()
        {
            gameState = Utils.FindNovaGameController().GameState;
            cameraPP  = mainCamera.GetComponent <PostProcessing>();

            if (!string.IsNullOrEmpty(luaName))
            {
                LuaRuntime.Instance.BindObject(luaName, this);
                gameState.AddRestorable(this);
            }
        }
예제 #4
0
        public override void Awake()
        {
            base.Awake();

            if (barrelMaterial != null)
            {
                barrelMaterialInstance = new Material(barrelMaterial);
            }

            uiPP = UICameraHelper.Active.GetComponent <PostProcessing>();
        }
예제 #5
0
 static int OnDestroy(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         Nova.PostProcessing obj = (Nova.PostProcessing)ToLua.CheckObject <Nova.PostProcessing>(L, 1);
         obj.OnDestroy();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #6
0
 static int Restore(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Nova.PostProcessing obj  = (Nova.PostProcessing)ToLua.CheckObject <Nova.PostProcessing>(L, 1);
         Nova.IRestoreData   arg0 = (Nova.IRestoreData)ToLua.CheckObject <Nova.IRestoreData>(L, 2);
         obj.Restore(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #7
0
 static int GetRestoreData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         Nova.PostProcessing obj = (Nova.PostProcessing)ToLua.CheckObject <Nova.PostProcessing>(L, 1);
         Nova.IRestoreData   o   = obj.GetRestoreData();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #8
0
 static int OnRenderImage(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         Nova.PostProcessing       obj  = (Nova.PostProcessing)ToLua.CheckObject <Nova.PostProcessing>(L, 1);
         UnityEngine.RenderTexture arg0 = (UnityEngine.RenderTexture)ToLua.CheckObject <UnityEngine.RenderTexture>(L, 2);
         UnityEngine.RenderTexture arg1 = (UnityEngine.RenderTexture)ToLua.CheckObject <UnityEngine.RenderTexture>(L, 3);
         obj.OnRenderImage(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #9
0
    static int get_asProxyOf(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Nova.PostProcessing obj = (Nova.PostProcessing)o;
            Nova.PostProcessing ret = obj.asProxyOf;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index asProxyOf on a nil value"));
        }
    }
예제 #10
0
    static int set_cameraPP(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Nova.TimelineController obj  = (Nova.TimelineController)o;
            Nova.PostProcessing     arg0 = (Nova.PostProcessing)ToLua.CheckObject <Nova.PostProcessing>(L, 2);
            obj.cameraPP = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index cameraPP on a nil value"));
        }
    }
예제 #11
0
    static int set_layersCount(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Nova.PostProcessing obj = (Nova.PostProcessing)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.layersCount = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index layersCount on a nil value"));
        }
    }
예제 #12
0
    static int set_asProxyOf(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Nova.PostProcessing obj  = (Nova.PostProcessing)o;
            Nova.PostProcessing arg0 = (Nova.PostProcessing)ToLua.CheckObject <Nova.PostProcessing>(L, 2);
            obj.asProxyOf = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index asProxyOf on a nil value"));
        }
    }
예제 #13
0
    static int set_luaName(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Nova.PostProcessing obj = (Nova.PostProcessing)o;
            string arg0             = ToLua.CheckString(L, 2);
            obj.luaName = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index luaName on a nil value"));
        }
    }
예제 #14
0
    static int get_restorableObjectName(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Nova.PostProcessing obj = (Nova.PostProcessing)o;
            string ret = obj.restorableObjectName;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index restorableObjectName on a nil value"));
        }
    }
예제 #15
0
    static int get_layersCount(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Nova.PostProcessing obj = (Nova.PostProcessing)o;
            int ret = obj.layersCount;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index layersCount on a nil value"));
        }
    }
예제 #16
0
    static int get_cameraPP(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Nova.TimelineController obj = (Nova.TimelineController)o;
            Nova.PostProcessing     ret = obj.cameraPP;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index cameraPP on a nil value"));
        }
    }
예제 #17
0
        public void SetTimelinePrefab(string timelinePrefabName)
        {
            if (timelinePrefabName == currentTimelinePrefabName)
            {
                return;
            }

            ClearTimelinePrefab();
            timelinePrefab = LoadTimelinePrefab(timelinePrefabName);
            timeline       = Instantiate(timelinePrefab, transform);
            timeline.SetActive(false);

            playableDirector = timeline.GetComponent <PlayableDirector>();
            if (playableDirector != null)
            {
                playableDirector.timeUpdateMode = DirectorUpdateMode.Manual;
                playableDirector.playOnAwake    = false;
                playableDirector.Evaluate();
            }

            Camera newCamera = timeline.GetComponentInChildren <Camera>();

            if (newCamera != null)
            {
                PostProcessing ppClient = newCamera.GetComponent <PostProcessing>();
                ppClient.asProxyOf = cameraPP;
                mainCamera.GetComponent <CameraController>().overridingCamera = newCamera;
                mainCamera.enabled      = false;
                newCamera.targetTexture = mainCamera.targetTexture;
                this.RuntimeAssert(newCamera.GetComponent <CameraController>() == null,
                                   "Timeline does not include another CameraController.");
                // Debug.Log("Switched main camera to timeline provided camera");
            }

            timeline.SetActive(true);
            currentTimelinePrefabName = timelinePrefabName;
        }