コード例 #1
0
    // Use this for initialization
    void Start()
    {
        Instance = this;

        _controllers = new List <IController>();

        Contexts    contexts = Contexts.sharedInstance;
        GameContext context  = contexts.game;

        _rootSystem = new RootSystem(contexts);

        _rootSystem.Initialize();

        HexGenerator.Instance = GetComponent <HexGenerator>();

        PlayerHealthModel = new PlayerHealthModel(20);

        PlayerHealthController PlayerHealthController = new PlayerHealthController
        {
            View       = PlayerHealthView,
            Model      = PlayerHealthModel,
            MainMenuUI = MainMenuUI
        };

        PlayerHealthController.Init();

        AboutController About = new AboutController
        {
            View    = AboutView,
            AboutUI = AboutUI
        };

        About.Init();

        MainMenuController MainMenu = new MainMenuController
        {
            View       = MainMenuView,
            MainMenuUI = MainMenuUI,
            AboutUI    = AboutUI
        };

        MainMenu.Init();

        StartModel = new StartModel();

        StartController start = new StartController
        {
            View  = StartView,
            Model = StartModel
        };

        start.Init();

        CreateMoneyController();

        TowerModel model = CreateTowerController();

        CreateTiles(context, model);
    }
コード例 #2
0
 private void Awake()
 {
     _inputs  = new Inputs();
     _player  = FindObjectOfType <PlayerConfig>();
     _sources = FindObjectsOfType <NGravitySourceConfig>();
     // New models
     _staminaModel = new PlayerStaminaModel();
     _healthModel  = new PlayerHealthModel();
     // Creeate Ecs
     _world       = new EcsWorld();
     _update      = new EcsSystems(_world);
     _fixedUpdate = new EcsSystems(_world);
 }
コード例 #3
0
        private void Start()
        {
            m_playerHealthModel = GetComponent <PlayerHealthModel>();
            m_photonView        = GetComponent <PhotonView>();

            if (m_photonView.Owner.IsKing())
            {
                m_playerHealthModel.OnChangeHealthEvent += HealthChanged;
                SetScale();

                if (Effect != null)
                {
                    Effect.Play(true);
                }
            }
        }
コード例 #4
0
 private void Start()
 {
     m_healthModel = GetComponent <PlayerHealthModel>();
 }
コード例 #5
0
 public void Init(PlayerHealthModel healthModel)
 {
     m_healthHandler            = healthModel;
     healthModel.OnPlayerDeath += StartCountdown;
 }