Esempio n. 1
0
        public static ReloadLevelEventArgs Create(LevelData levelData, object userData = null)
        {
            ReloadLevelEventArgs reloadLevelEventArgs = ReferencePool.Acquire <ReloadLevelEventArgs>();

            reloadLevelEventArgs.LevelData = levelData;
            reloadLevelEventArgs.UserData  = userData;
            return(reloadLevelEventArgs);
        }
        private void OnReloadLevel(object sender, GameEventArgs e)
        {
            ReloadLevelEventArgs ne = (ReloadLevelEventArgs)e;

            if (ne == null)
            {
                return;
            }

            if (ne.LevelData == null)
            {
                Log.Error("Load level event param LevelData is null");
                return;
            }

            if (ne.LevelData.SceneData == null)
            {
                Log.Error("Load level event param SceneData is null");
                return;
            }

            levelControl.Restart();
        }