/// <summary> /// 设置当前场景并进入当前场景 /// </summary> /// <param name="state"></param> public void SetScene(SceneState state) { if (sceneState != null) { sceneState.OnExit(); } sceneState = state; if (sceneState != null) { sceneState.OnEnter(); } }
/// <summary> /// 设置并进入当前场景 /// </summary> /// <param name="state">场景类</param> public void SetScene(SceneState state) { sceneState?.OnExit(); sceneState = state; sceneState?.OnEnter(); }