Example #1
0
        private void Awake()
        {
            game = ClientGame.Instance.game;
            game.matchManager.onEvent += ProcessMatchEvent;

            uiCamera = this.GetComponentInChildren <Camera>();

            viewFadeInOut        = UIManager.Instance.AddView("FadeInOut", this.transform.Find("Canvas/Add")) as FullScreenFadeInOut;
            viewReadyGo          = UIManager.Instance.AddView("ReadyGo", this.transform.Find("Canvas/Base/AnchorCenter")) as WidgetReadyGo;
            viewRoundDeclaration = UIManager.Instance.AddView("RoundDeclaration", this.transform.Find("Canvas/Base/AnchorCenter")) as WidgetRoundDeclaration;
            viewKO       = UIManager.Instance.AddView("KO", this.transform.Find("Canvas/Base/AnchorCenter")) as WidgetKO;
            viewTimeOver = UIManager.Instance.AddView("TimeOver", this.transform.Find("Canvas/Base/AnchorCenter")) as WidgetTimeOver;
            viewWinner   = UIManager.Instance.AddView("Winner", this.transform.Find("Canvas/Base/AnchorCenter")) as WidgetWinner;
            viewDrawGame = UIManager.Instance.AddView("DrawGame", this.transform.Find("Canvas/Base/AnchorCenter")) as WidgetDrawGame;
        }
Example #2
0
        protected void CreateGame(MatchInfo matchInfo, int logicFPS)
        {
            StageConfig stageConfig = ConfigReader.Parse <StageConfig>(ResourceLoader.LoadText("Stage/" + matchInfo.stage + "/" + matchInfo.stage + ".def"));
            WorldConfig worldConfig = new WorldConfig();

            worldConfig.SetStageConfig(stageConfig);
            this.game = new Game(matchInfo, worldConfig, logicFPS);

            LoadFightHud();

            viewWorld = new ViewWorld(game.world);
            viewWorld.InitScene(this.gameObject);
            viewWorld.CreateStage(worldConfig.stageConfig.stage);

            viewWorld.CreateCamera(this.game.world.cameraController);
        }