Skip to content

SystemData

muxigame edited this page Nov 24, 2021 · 1 revision

系统数据 System Data

$\textcolor{RedOrange}{GalForUnity.System.GameSystem.SystemData}$

GalForUnity.System.GameSystem.SystemData 即游戏系统数据,保存着游戏内的重要引用

功能

image-20210106204533759

GalForUnity.System.GameSystem.SystemData:是GalForUnity里最重要的类之一,记录着系统数据,与他的外部类不同,他是数据的实际保存者

字段

名称 描述
GameTime CurrentTime 系统的当前时间
RoleModel CurrentRoleModel 系统的当前角色模型
SceneModel CurrentSceneModel 系统的当前场景模型
SceneController SceneController 系统当前的场景控制器
RoleController RoleController 系统当前的角色场景
PlotFlowController PlotFlowController 系统当前的剧情流控制器
ShowPlotView ShowPlotView 系统当前UI视图
OptionController OptionController 系统当前的选项控制器
RunOnMono currentMonoProxy 系统当前的Mono代理

方法

//空空如也

源代码

	[Serializable]
		public class SystemData{
			public GameTime CurrentTime{
				get => currentTime;
				set => currentTime = value;
			}

			[Rename("当前时间")] [SerializeField] private GameTime currentTime = new GameTime(2021, 1, 1);

			/// <summary>
			/// 一般情况下记录着主角的角色模型,当有程序修该值,触发事件
			/// </summary>
			public RoleModel CurrentRoleModel{
				get => currentRoleModel;
				set{
					currentRoleModel = value;
					EventCenter.GetInstance().RoleStateChangeEvent(currentRoleModel);//当有程序修改当前角色模型是,触发事件
				}
			}

			[Rename("当前角色")] [SerializeField] private RoleModel currentRoleModel;

			/// <summary>
			/// 对此参数的修改会触发场景变换数据
			/// </summary>
			public SceneModel CurrentSceneModel{
				get{
					return currentSceneModel??SceneModel.NULL;
				}
				set{
					currentSceneModel = value;
					EventCenter.GetInstance().SceneStateChangeEvent.Invoke(currentSceneModel); //当有程序修改当前场景模型是,触发事件
				}
			}

			[Rename("当前场景")] [SerializeField] private SceneModel currentSceneModel;
			[Rename("场景控制器")] public SceneController SceneController;
			[Rename("角色控制器")] public RoleController RoleController;
			[Rename("剧情流控制器")] public PlotFlowController PlotFlowController;
			[Rename("视图容器")] public ShowPlotView ShowPlotView;
		}

Clone this wiki locally