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


C# PlayerManager.CmdSpawnBalls方法代码示例

本文整理汇总了C#中PlayerManager.CmdSpawnBalls方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerManager.CmdSpawnBalls方法的具体用法?C# PlayerManager.CmdSpawnBalls怎么用?C# PlayerManager.CmdSpawnBalls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PlayerManager的用法示例。


在下文中一共展示了PlayerManager.CmdSpawnBalls方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnStateEntering

    // Stuff done once if you enter a state
    void OnStateEntering()
    {
        switch (GameState ()) {
        case State.Intro:
            player.CmdKillAllBalls();
            introBackground.SetActive(true);
            this._introTimePassed = 0.0f;
            if (useOVR)
            {
                this.ovrCam.transform.position = introOVRCamPosition;
            }
            else
            {
                SwitchCamera(this.introCam);
            }
            if (startFading == true)
                startFading = false;
            if (fadeOutStarted == true)
                fadeOutStarted = false;
            if (introAlmostDone == true)
                introAlmostDone = false;
            if (introIsDone == true)
                introIsDone = false;

            //if (introText) {
            //	introText.SetActive (true);
            //	MovingText text = introText.GetComponent<MovingText> ();
            //	text.Reset ();
            //}
            //Debug.Log("EnterIntro");

            break;

        case State.Fight:

            var playerObj = GameObject.FindWithTag ("Player");
            this.player = playerObj.GetComponent<PlayerManager> ();
            if (!hasSpawnedObjects) {
                player.CmdSpawnObjects ();
                hasSpawnedObjects = true;
            } /*else {
                player.CmdSpawnBalls();
            }*/
            player.CmdKillAllBalls();
            ballsSpawned = 0;
            player.CmdSpawnBalls();
            ballsSpawned = 1;
            if (useOVR) {
                this.ovrCam.transform.position = fightOVRCamPosition;
            }
            this.score = 0;
            this.timeRemaining = 60.0f;

            this.scoreText.text = "Score: 0";
            this.timeText.text = "Time left: 10";
            this.highScoreText.text = "HighScore: " + this.highScore;
            if (useOVR) {
                SwitchCamera (this.ovrCam);
            } else {
                SwitchCamera (this.mainCam);
            }

            break;

        case State.Win:
            player.CmdKillAllBalls();
            this.winText.SetActive (true);
            break;

        case State.Loose:

            // What todo if the player looses.

            break;

        case State.NetworkSetup:
            this._networkSetupTimePassed = 0.0f;
            Debug.Log ("Press H to start Host, press C (or wait) to start Client.");
            break;
        case State.Spectating:
            freeLookCameraRig.SetActive (true);
            SwitchCamera (this.specCam);
            break;
        }
    }
开发者ID:stefanseibert,项目名称:padawan101,代码行数:86,代码来源:MainEngine.cs


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