• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SceneState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SceneState的典型用法代码示例。如果您正苦于以下问题:C# SceneState类的具体用法?C# SceneState怎么用?C# SceneState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SceneState类属于命名空间,在下文中一共展示了SceneState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: Update

 // Update is called once per frame
 void Update()
 {
     switch (currentState) {
         case SceneState.Walking:
             if (target != null) {
                 if(orbitY) {
                     if(totalAngle < 110) {
                         transform.RotateAround(target.transform.position, Vector3.up, Time.deltaTime * camRotateSpeed);
                         totalAngle += 10 * Time.deltaTime;
                     } else {
                         currentState = SceneState.hearsSomething;
                     }
                 }
             }
             break;
         case SceneState.hearsSomething:
             waitTimerHearsSomething += Time.deltaTime;
             if(waitTimerHearsSomething >= waitTime) {
                 //TODO: zoom into facial expression if can
                 currentState = SceneState.reaperGiantFight;
             }
             break;
         case SceneState.reaperGiantFight:
             transform.LookAt(transformToLookAt.transform);
             //Debug.Log(transformToLookAt.transform);
             //transform.LookAt (new Vector3(0,-.3f,-1));
             //TODO: Zoom in on the fight
             waitTimeCameraFight += Time.deltaTime;
             if(waitTimeCameraFight <= waitTime) {
                 transform.Translate(Vector3.forward * Time.deltaTime * 14);
             } else {
                 currentState = SceneState.runToHelp;
             }
             break;
         case SceneState.runToHelp:
             //waitFor3Seconds();
             waitTimeWatchFight += Time.deltaTime;
             if(waitTimeWatchFight >= waitTimeForFight) {
                 if(transform.position.x < 150.0) {
                     transform.Translate(new Vector3(0, 0, -1));
                     //TODO: stablize the camera, it keeps bouncing back and forth
                 } else {
                     //Switch to zoom into scythe
                     mainCamera.GetComponent<MainCameraScript>().SwitchToCam4();
                 }
             }
             break;
     }
 }
开发者ID:Calvin-Liu,项目名称:Unity-Animation,代码行数:50,代码来源:GuyCameraScript.cs


示例17: 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();
            Application.Graphics.DeviceReset += (sender, args) => {
                _isProjectionDirty = true; };
        }
开发者ID:rc183,项目名称:igf,代码行数:22,代码来源:Camera3d.cs


示例18: GameScene

		public GameScene(GameData data, SpriteBatch SpriteBatch) {
			this.SpriteBatch = SpriteBatch;
			this.UIManager = new UIManager();
			this.Data = data;
			World = Data.RegionData.CreateWorld(this, SpriteBatch.GraphicsDevice);
			World.Maps.Add(Data.MapDatas[0].CreateMap(World));

			EntityTemplate templatePlayer = World.EntityContainer.GetPlayers()[0];

			Player = templatePlayer.CreateEntity(World.EntityFactory, true) as PlayerEntity;
			World.Player = Player;
			World.Maps[0].AddEntity(Player);
			new LivingController(Player);
			World.CurrentMap = Player.Map;
			this.SceneState = SceneState.Alive;
		}
开发者ID:Hakua,项目名称:PokeSharp,代码行数:16,代码来源:GameScene.cs


示例19: SetScene

 void SetScene(SceneState state)
 {
     if (state == SceneState.BillieJean) {
     ActivateBillieJean(true);
     ActivateFireFloors(false);
     ActivateWaterFloors(false);
     } else if (state == SceneState.FireFloors) {
     ActivateBillieJean(false);
     ActivateFireFloors(true);
     ActivateWaterFloors(false);
     } else if (state == SceneState.WaterFloors) {
     ActivateBillieJean(true);
     ActivateFireFloors(false);
     ActivateWaterFloors(true);
     }
 }
开发者ID:corybarr,项目名称:PlanetariumSwarm,代码行数:16,代码来源:SceneSwitcher.cs


示例20: Awake

	// Use this for initialization
	void Awake() 
	{
		//SIMON.GlobalSIMON.CleanSIMONEnvironment ();
		SIMON.GlobalSIMON.CleanSIMONGroup (GameTimeManager_Simulation.GroupC);
		SIMON.GlobalSIMON.CleanSIMONGroup (GameTimeManager_Simulation.GroupA);
		SIMON.GlobalSIMON.CleanSIMONGroup (GameTimeManager_Simulation.GroupB);
		SIMON.GlobalSIMON.CleanSIMONGroup (GameTimeManager.GroupA);
		SIMON.GlobalSIMON.CleanSIMONGroup (GameTimeManager.GroupB);
		SIMON.GlobalSIMON.CleanSIMONGroup (GameTimeManager_Compare.GroupB);
		SIMON.GlobalSIMON.CleanSIMONGroup (GameTimeManager_Compare.GroupA);

		SIMON.GlobalSIMON.CleanSIMONEnvironment ();
		PlayGame_State = 1;
		SM = this;
		sceneState = SceneState.scene_menu;
	//	btnStartGame.GetComponent<Animator> ().
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:18,代码来源:SceneManager.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SceneView类代码示例发布时间:2022-05-24
下一篇:
C# SceneObjectPart类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap