コード例 #1
0
        void Update()
        {
            try
            {
                LiteManager.Tick(Time.deltaTime);
            }
            catch (System.Exception Ex)
            {
                LLogger.LError($"{Ex.Message}\n{Ex.StackTrace}");
            }

#if UNITY_EDITOR
            if (Input.GetKeyDown(KeyCode.F1))
            {
                LiteManager.TimeScale = 0.5f;
                LLogger.LWarning($"TimeScale = {LiteManager.TimeScale}");
            }
            else if (Input.GetKeyDown(KeyCode.F2))
            {
                LiteManager.TimeScale = 1.0f;
                LLogger.LWarning($"TimeScale = {LiteManager.TimeScale}");
            }
            else if (Input.GetKeyDown(KeyCode.F3))
            {
                LiteManager.TimeScale = 5.0f;
                LLogger.LWarning($"TimeScale = {LiteManager.TimeScale}");
            }
            else if (Input.GetKeyDown(KeyCode.PageUp))
            {
                LiteManager.TimeScale--;
                LLogger.LWarning($"TimeScale = {LiteManager.TimeScale}");
            }
            else if (Input.GetKeyDown(KeyCode.PageDown))
            {
                LiteManager.TimeScale++;
                LLogger.LWarning($"TimeScale = {LiteManager.TimeScale}");
            }

            if (Input.GetKeyDown(KeyCode.F5))
            {
                LiteManager.Restart();
            }
            else if (Input.GetKeyDown(KeyCode.F6))
            {
                LiteManager.Shutdown();
            }
            else if (Input.GetKeyDown(KeyCode.F9))
            {
                EnableGizmos_ = !EnableGizmos_;
            }
            else if (Input.GetKeyDown(KeyCode.F12))
            {
                OnApplicationPause(!LiteManager.IsPause);
            }
#endif
        }
コード例 #2
0
 void OnApplicationQuit()
 {
     try
     {
         LiteManager.Shutdown();
     }
     catch (System.Exception Ex)
     {
         LLogger.LError($"{Ex.Message}\n{Ex.StackTrace}");
     }
 }
コード例 #3
0
 void OnApplicationPause(bool Pause)
 {
     if (Pause)
     {
         LiteManager.OnEnterBackground();
     }
     else
     {
         LiteManager.OnEnterForeground();
     }
 }
コード例 #4
0
        void Awake()
        {
            try
            {
                var LogicType = System.Type.GetType(LogicClassName);
                if (LogicType == null)
                {
                    throw new LiteException($"can't not find game logic class type : {LogicClassName}");
                }

                if (!(System.Activator.CreateInstance(LogicType) is ILogic Logic))
                {
                    throw new LiteException("LiteMain Logic must not be null");
                }

                LiteManager.Startup(this, Logic);
            }
            catch (System.Exception Ex)
            {
                LLogger.LError($"{Ex.Message}\n{Ex.StackTrace}");
            }
        }