示例#1
0
 public CommandContainer(Command cmd, float executeDelay)
 {
     TimeCalled = Time.timeSinceLevelLoad;
     ExecuteDelayTime = executeDelay;
     DelayType = DelayTypes.Time;
     Cmd = cmd;
 }
示例#2
0
 public CommandContainer(Command cmd, int executeDelay)
 {
     FrameCalled = Time.frameCount;
     ExecuteDelayFrame = executeDelay;
     DelayType = DelayTypes.Frame;
     Cmd = cmd;
 }
示例#3
0
 static void OnSceneLoaded(Command c)
 {
     var cmd = c as SceneLoadedCmd;
     _cachedSceneView = cmd.View;
     cmd.View.StartCoroutine("ValidateSceneObjects");
     cmd.View.Initialize();
     cmd.View.SceneObjects.InitializeSceneObjects();
 }
示例#4
0
        static void OnChangeScene(Command c)
        {
            var cmd = c as ChangeSceneCmd;

            GC.Collect();

            // enter transition scene
            Framework.PushCommand(new LoadNextSceneCmd(cmd.SceneName), 1);
            Application.LoadLevel(Framework.TransitionScene);
        }
示例#5
0
        static void OnLoadNextScene(Command c)
        {
            var cmd = c as LoadNextSceneCmd;

            // load the new scene
            if (Application.HasProLicense())
                Application.LoadLevelAsync(cmd.SceneName);
            else
            {
                Application.LoadLevel(cmd.SceneName);
            }
        }
        static void OnChangeScene(Command cmd)
        {
            var cCmd = (ChangeSceneCmd)cmd;

            GC.Collect();

            IsSceneInitialized = false;

            // enter transition scene
            // UnityEngine.Application.LoadLevel(Framework.TransitionScene);
            // load the new scene
            if(UnityEngine.Application.HasProLicense())
                UnityEngine.Application.LoadLevelAsync(cCmd.SceneName);
            else
                UnityEngine.Application.LoadLevel(cCmd.SceneName);
        }
示例#7
0
 /// <summary>
 /// Enqueue a command with a delayed execution in seconds
 /// </summary>
 /// <param name="cmd"></param>
 /// <param name="timeDelay"></param>
 public void Push(Command cmd, float timeDelay)
 {
     _q.Enqueue(new CommandContainer(cmd, timeDelay));
 }
示例#8
0
 /// <summary>
 /// Enqueue a command with a delayed execution in frames
 /// </summary>
 /// <param name="cmd"></param>
 /// <param name="frameDelay"></param>
 public void Push(Command cmd, int frameDelay)
 {
     _q.Enqueue(new CommandContainer(cmd, frameDelay));
 }
示例#9
0
 /// <summary>
 /// Accessor function for putting commands into the game queue
 /// </summary>
 /// <param name="cmd"></param>
 public void Push(Command cmd)
 {
     _q.Enqueue(new CommandContainer(cmd, 0));
 }
示例#10
0
 protected virtual void OnApplyOptions(Command cmd)
 {
     Screen.SetResolution(Options.Width, Options.Height, Options.FullScreen);
     // TODO: apply options as necessary
 }
示例#11
0
        static void OnSceneLoaded(Command cmd)
        {
            var cCmd = (SceneLoadedCmd) cmd;

            cCmd.View.Initialize();

            IsSceneInitialized = true;
        }
示例#12
0
 void OnApplyOptions(Command cmd)
 {
     Screen.SetResolution(Options.Width, Options.Height, Options.FullScreen);
     QualitySettings.vSyncCount = Options.Vsync ? 1 : 0;
     // TODO: apply options as necessary
 }
示例#13
0
 /// <summary>
 /// push a command with a timed execution delay
 /// </summary>
 /// <param name="cmd">the command</param>
 /// <param name="timeDelay"># of seconds to wait until command will be executed</param>
 public static void PushCommand(Command cmd, float timeDelay)
 {
     _commands.Push(cmd, timeDelay);
 }
示例#14
0
 /// <summary>
 /// push a command with a frame count execution delay
 /// </summary>
 /// <param name="cmd">the command</param>
 /// <param name="frameDelay"># of frames to wait until command will be executed</param>
 public static void PushCommand(Command cmd, int frameDelay)
 {
     _commands.Push(cmd, frameDelay);
 }
示例#15
0
 /// <summary>
 /// push a command with no delay into the command queue
 /// </summary>
 /// <param name="cmd">the command</param>
 public static void PushCommand(Command cmd)
 {
     _commands.Push(cmd);
 }
示例#16
0
 void OnApplyOptions(Command cmd)
 {
     WriteConfig();
 }