Example #1
0
        public async ETVoid RunAsync()
        {
            Game.Scene.AddComponent <ConfigComponent>();

            Options            options       = Game.Scene.GetComponent <Options>();
            StartProcessConfig processConfig = StartProcessConfigCategory.Instance.Get(options.Process);

            Game.Scene.AddComponent <TimerComponent>();
            Game.Scene.AddComponent <OpcodeTypeComponent>();
            Game.Scene.AddComponent <MessageDispatcherComponent>();
            Game.Scene.AddComponent <CoroutineLockComponent>();
            // 发送普通actor消息
            Game.Scene.AddComponent <ActorMessageSenderComponent>();
            // 发送location actor消息
            Game.Scene.AddComponent <ActorLocationSenderComponent>();
            // 访问location server的组件
            Game.Scene.AddComponent <LocationProxyComponent>();
            Game.Scene.AddComponent <ActorMessageDispatcherComponent>();
            // 数值订阅组件
            Game.Scene.AddComponent <NumericWatcherComponent>();
            // 控制台组件
            Game.Scene.AddComponent <ConsoleComponent>();

            Game.Scene.AddComponent <NetInnerComponent, string>(processConfig.InnerAddress);

            var processScenes = StartSceneConfigCategory.Instance.GetByProcess(IdGenerater.Process);

            foreach (StartSceneConfig startConfig in processScenes)
            {
                await SceneFactory.Create(Game.Scene, startConfig.SceneId, startConfig.Zone, startConfig.Name, startConfig.Type, startConfig);
            }
        }
 public override void Run()
 {
     foreach (StartConfig startConfig in StartConfigComponent.Instance.StartConfig.List)
     {
         SceneConfig sceneConfig = startConfig.GetComponent <SceneConfig>();
         SceneFactory.Create(Game.Scene, startConfig.Id, sceneConfig.Name, sceneConfig.SceneType);
     }
 }
Example #3
0
        public async ETVoid RunInner()
        {
            var processScenes = StartSceneConfigCategory.Instance.GetByProcess(IdGenerater.Process);

            foreach (StartSceneConfig startConfig in processScenes)
            {
                await SceneFactory.Create(Game.Scene, startConfig.SceneId, startConfig.Zone, startConfig.Name, startConfig.Type, startConfig);
            }
        }
Example #4
0
    public void AddDiedCount()
    {
        diedCount++;
        lives--;

        if (lives == 0)
        {
            currentState = SceneState.SummaryScreen;
            scene        = SceneFactory.Create(currentState);
            SceneManager.LoadScene(currentState.ToString());
        }
    }
Example #5
0
 public void NextScene()
 {
     if (currentState == SceneState.SummaryScreen)
     {
         Init();
     }
     else
     {
         currentState++;
         scene = SceneFactory.Create(currentState);
     }
     SceneManager.LoadScene(currentState.ToString());
 }
Example #6
0
    public void Init()
    {
        levelTime = new float[TOTAL_LEVEL];
        for (int i = 0; i < levelTime.Length; i++)
        {
            levelTime[i] = 0;
        }

        lives     = 10;
        diedCount = 0;
        score     = 0;
        moveCount = 0;

        currentState = SceneState.StartScreen;
        scene        = SceneFactory.Create(currentState);
    }