当前位置: 首页>>代码示例>>C#>>正文


C# SceneState类代码示例

本文整理汇总了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;
                    }
            }
        }
开发者ID:msx752,项目名称:UltimaXNA,代码行数:35,代码来源:AState.cs

示例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);
        }
开发者ID:pquinn,项目名称:time-sink,代码行数:36,代码来源:ScreenManager.cs

示例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;
    }
开发者ID:dcolclazier,项目名称:THE_GAME,代码行数:27,代码来源:MainController.cs

示例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);
        }
    }
开发者ID:gucci5288,项目名称:iOS-Challenge,代码行数:29,代码来源:MainSceneControl.cs

示例5: Start

 // Use this for initialization
 void Start()
 {
     state = SceneState.ACTIVE;
     opScreenCover = 0.0f;
     opText = 0.0f;
     currAnimTick = 0.0f;
     maxAnimTime = 2.4f;
 }
开发者ID:CG-F15-20-Rutgers,项目名称:UnityProjects,代码行数:9,代码来源:SceneController.cs

示例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();
 }
开发者ID:rc183,项目名称:igf,代码行数:12,代码来源:Camera2d.cs

示例7: MySceneBehavior

 public MySceneBehavior()
     : base("MySceneBehavior")
 {
     this.diagnostics = false;
     WaveServices.ScreenContextManager.SetDiagnosticsActive(this.diagnostics);
     this.sceneState = SceneState.EMITER;
     this.gravityIndex = 0;
 }
开发者ID:123asd123A,项目名称:Samples,代码行数:8,代码来源:MySceneBehavior.cs

示例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);
 }
开发者ID:ArieLeo,项目名称:MecWarriors-ExamplePackages,代码行数:9,代码来源:SceneManager.cs

示例9: changeAndMoveScene

	public int changeAndMoveScene(SceneState stateNum)
	{
		if (SM.sceneState != stateNum) 
		{
			SM.sceneState = stateNum;
			moveScene();
			return 1;
		} 
		else
			return 0;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:11,代码来源:SceneManager.cs

示例10: Update

 void Update()
 {
     if (Time.timeSinceLevelLoad - lastSwitchSeconds > intervalSeconds) {
     lastSwitchSeconds = Time.timeSinceLevelLoad;
     sceneState++;
     if (sceneState > SceneState.WaterFloors) {
     sceneState = SceneState.FireFloors;
     }
     SetScene(sceneState);
     }
 }
开发者ID:corybarr,项目名称:PlanetariumSwarm,代码行数:11,代码来源:SceneSwitcher.cs

示例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;
    }
开发者ID:Richy321,项目名称:TowerDefenseSolver,代码行数:12,代码来源:SceneController.cs

示例12: Start

	void Start () {
        mainCamera = Camera.main;

        playerController = GetComponent<PlayerController>();

        if(!sceneDebug)
        {
            actualSceneState = SceneState.FirstScene;
            disableAllButtons();
            firstScene.enableButtons();
        }
    }
开发者ID:stadoblech,项目名称:Mini-rogue,代码行数:12,代码来源:ScenesManager.cs

示例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();
        }
开发者ID:VICOGameStudio-Ujen,项目名称:igf,代码行数:20,代码来源:Camera3d.cs

示例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>();
        }
开发者ID:Crwth,项目名称:UltimaXNA,代码行数:13,代码来源:BaseScene.cs

示例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();
    }
开发者ID:sgyli7,项目名称:GarageKit_for_Unity,代码行数:15,代码来源:SceneStateManager.cs


注:本文中的SceneState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。