本文整理汇总了C#中SceneState类的典型用法代码示例。如果您正苦于以下问题:C# SceneState类的具体用法?C# SceneState怎么用?C# SceneState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SceneState类属于命名空间,在下文中一共展示了SceneState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
public virtual void Update(double totalTime, double frameTime)
{
m_elapsed += (float)frameTime;
switch (m_sceneState)
{
case SceneState.TransitioningOn:
{
m_transitionAlpha = 1 - (m_elapsed / (float)TransitionOffLength.TotalSeconds);
if (m_elapsed >= (float)TransitionOnLength.TotalSeconds)
{
m_elapsed = 0;
m_sceneState = SceneState.Active;
}
break;
}
case SceneState.TransitioningOff:
{
m_transitionAlpha = m_elapsed / (float)TransitionOnLength.TotalSeconds;
if (m_elapsed >= (float)TransitionOffLength.TotalSeconds)
{
m_elapsed = 0;
m_sceneState = SceneState.None;
if (TransitionCompleted != null)
TransitionCompleted();
}
break;
}
}
}
示例2: ScreenManager
/// <summary>
/// Constructs a new screen manager component.
/// </summary>
public ScreenManager(Game game)
: base(game)
{
// we must set EnabledGestures before we can query for them, but
// we don't assume the game wants to read them.
TouchPanel.EnabledGestures = GestureType.None;
// Create the lighting system.
sunBurnCoreSystem = new SunBurnCoreSystem(game.Services, game.Content);
sceneState = new SceneState();
// Create the scene interface. Acts as a service provider containing all scene managers
// and returning them by type (including custom managers). Also acts as a component
// container where calls to manager methods on the SceneInterface (such as BeginFrameRendering,
// Unload, ...) are automatically called on all contained managers.
//
// This design allows managers to be plugged-in like modular components and for managers
// to easily be added, removed, or replaced with custom implementations.
//
sceneInterface = new SceneInterface();
sceneInterface.CreateDefaultManagers(RenderingSystemType.Forward, CollisionSystemType.Physics, true);
// Create the frame buffers used for rendering (sized to the backbuffer) and
// assign them to the ResourceManager so we don't have to worry about cleanup.
frameBuffers = new FrameBuffers(DetailPreference.High, DetailPreference.Medium);
sceneInterface.ResourceManager.AssignOwnership(frameBuffers);
// Post console messages letting the user know how to open the SunBurn Editor.
sceneInterface.ShowConsole = true;
SystemConsole.AddMessage("Welcome to the SunBurn Engine.", 4);
SystemConsole.AddMessage("Use an Xbox controller or the W, A, S, D keys to navigate the scene.", 8);
SystemConsole.AddMessage("Press F11 to open the SunBurn Editor.", 12);
}
示例3: Awake
//sets scene to main menu by default
public void Awake()
{
//keep alive
DontDestroyOnLoad(gameObject);
_mainController = this;
_updateDelegates = new UpdateDelegate[(int)SceneState.Count];
_updateDelegates[(int)SceneState.Reset] = SceneStateReset;
_updateDelegates[(int)SceneState.Preload] = SceneStatePreload;
_updateDelegates[(int)SceneState.Load] = SceneStateLoad;
_updateDelegates[(int)SceneState.Unload] = SceneStateUnload;
_updateDelegates[(int)SceneState.PostLoad] = ScreenStatePostLoad;
_updateDelegates[(int)SceneState.Ready] = ScreenStateReady;
_updateDelegates[(int)SceneState.Run] = ScreenStateRun;
_nextSceneName = "MainMenu";
//testing event messaging system
Messenger.AddListener<string>("Scene change",Test);
Messenger.MarkAsPermanent("Scene change"); // <-- persists through scene changes
Messenger.Broadcast("Scene change", _nextSceneName);
//oh yeah... that's how I like it.
_currentSceneState = SceneState.Reset;
}
示例4: SetState
public void SetState(SceneState state)
{
State = state;
if (state == SceneState.LookScene)
{
MenuListUI.gameObject.SetActive(false);
MenuItemUI.gameObject.SetActive(false);
virtualTouch.joystickRight.gameObject.SetActive(true);
virtualTouch.joystickLeft.gameObject.SetActive(true);
}
else if (state == SceneState.LookMenuList)
{
MenuListUI.gameObject.SetActive (true);
MenuItemUI.gameObject.SetActive(false);
virtualTouch.joystickRight.gameObject.SetActive(false);
virtualTouch.joystickLeft.gameObject.SetActive(false);
}
else if (state == SceneState.LookMenuItem)
{
MenuListUI.gameObject.SetActive (false);
MenuItemUI.gameObject.SetActive(true);
virtualTouch.joystickRight.gameObject.SetActive(false);
virtualTouch.joystickLeft.gameObject.SetActive(false);
}
}
示例5: Start
// Use this for initialization
void Start()
{
state = SceneState.ACTIVE;
opScreenCover = 0.0f;
opText = 0.0f;
currAnimTick = 0.0f;
maxAnimTime = 2.4f;
}
示例6: Camera2D
/// <summary>
/// Creates a new Camera instance
/// </summary>
/// <param name = "aspectRatio">The viewport aspect ratio</param>
protected Camera2D(float aspectRatio)
{
AspectRatio = aspectRatio;
Distance = 1.0f;
SceneState = new SceneState();
SceneEnvironment = new SceneEnvironment();
}
示例7: MySceneBehavior
public MySceneBehavior()
: base("MySceneBehavior")
{
this.diagnostics = false;
WaveServices.ScreenContextManager.SetDiagnosticsActive(this.diagnostics);
this.sceneState = SceneState.EMITER;
this.gravityIndex = 0;
}
示例8: SetSceneState
//triggers events in the sequence
public void SetSceneState(SceneState state)
{
//sets the current scene state and then applies its value to all stored Animator components
currentSceneState = state;
char1Animator.SetInteger("SceneState", (int)currentSceneState);
doorAnimator.SetInteger("SceneState", (int)currentSceneState);
char2Animator.SetInteger("SceneState", (int)currentSceneState);
}
示例9: changeAndMoveScene
public int changeAndMoveScene(SceneState stateNum)
{
if (SM.sceneState != stateNum)
{
SM.sceneState = stateNum;
moveScene();
return 1;
}
else
return 0;
}
示例10: Update
void Update()
{
if (Time.timeSinceLevelLoad - lastSwitchSeconds > intervalSeconds) {
lastSwitchSeconds = Time.timeSinceLevelLoad;
sceneState++;
if (sceneState > SceneState.WaterFloors) {
sceneState = SceneState.FireFloors;
}
SetScene(sceneState);
}
}
示例11: Start
// Use this for initialization
void Start ()
{
mapInstances = FindObjectsOfType<Map>().ToList();
if (!waveManager)
waveManager = FindObjectOfType<WaveManager>();
waveManager.OnWaveFinished += OnWaveFinished;
waveManager.OnWaveStart += OnWaveStart;
ga = GetComponent<GeneticAlgorithm>();
state = SceneState.Idle;
}
示例12: Start
void Start () {
mainCamera = Camera.main;
playerController = GetComponent<PlayerController>();
if(!sceneDebug)
{
actualSceneState = SceneState.FirstScene;
disableAllButtons();
firstScene.enableButtons();
}
}
示例13: Camera3D
/// <summary>
/// Creates a new Camera instance
/// </summary>
/// <param name = "aspectRatio">The viewport aspect ratio</param>
/// <param name = "fieldOfView">The _instances of view expressed in radians</param>
/// <param name = "nearPlaneDistance">The nearest point in projected space of the camera</param>
/// <param name = "farPlaneDistance">The farest point in projected space of the camera</param>
protected Camera3D(float aspectRatio, float fieldOfView, float nearPlaneDistance,
float farPlaneDistance)
{
_aspectRatio = aspectRatio;
_fieldOfView = fieldOfView;
_nearPlaneDistance = nearPlaneDistance;
_farPlaneDistance = farPlaneDistance;
_isProjectionDirty = true;
SceneState = new SceneState();
SceneEnvironment = new SceneEnvironment();
}
示例14: BaseScene
public BaseScene(Game game, bool needsUIService)
{
_game = game;
_clearColor = Color.Black;
_content = new ContentManager(_game.Services);
_content.RootDirectory = "Content";
_sceneState = SceneState.TransitioningOn;
_sceneService = game.Services.GetService<ISceneService>(true);
_inputService = game.Services.GetService<IInputState>(true);
_worldService = game.Services.GetService<IIsometricRenderer>(true);
_uiService = game.Services.GetService<IUIManager>();
}
示例15: ChangeState
//Stateを変更する
public void ChangeState(SceneState sceneState)
{
//前Stateの終了処理
if(state != null)
state.StateExit();
currentState = sceneState;
//新規Stateのセット
state = Activator.CreateInstance(stateTable[sceneState]) as IState;
//新規Stateの初期化処理
state.StateStart();
}