浏览代码

Implemented Switchable Save Progress for Game Manager

/main
peeweek 5 年前
当前提交
f224492b
共有 2 个文件被更改,包括 8 次插入2 次删除
  1. 4
      Runtime/LevelScripting/Actions/GameLevelLoadAction.cs
  2. 6
      Runtime/Managers/Implementations/GameManager.cs

4
Runtime/LevelScripting/Actions/GameLevelLoadAction.cs


[ShowIf("isGameSave")]
public string UserSaveName = "Progress";
public bool SaveProgress = false;
[ReorderableList]
public Callable[] OnComplete;

break;
case Target.FromGameSave: index = manager.currentSaveProgress; break;
}
manager.SwitchLevel(index, ShowUI, OnComplete);
manager.SwitchLevel(index, ShowUI, OnComplete, SaveProgress);
}
}
}

6
Runtime/Managers/Implementations/GameManager.cs


return cameraFade;
}
public void SwitchLevel(int nextLevel, bool showUI = false, Callable[] onComplete = null)
public void SwitchLevel(int nextLevel, bool showUI = false, Callable[] onComplete = null, bool saveProgress = false)
{
if (m_CurrentLevelSwitch == null)
{

// Save Progression if not mainmenu
if(nextLevel != -1 && saveProgress)
currentSaveProgress = currentLevel;
}
else
Debug.LogWarning("SwitchLevel : an Operation was still in progress and switching level could not be done. ");

正在加载...
取消
保存