HUDController.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
    void Start()
    {
        this.playerHealth = PlayerController.instance.Health;
        startingMaxHealth = this.playerHealth.maxHealth;

        this.inventory = new GameObject ();
        this.inventory.transform.parent = this.gameObject.transform;

        this.resolution = this.GetComponent<CanvasScaler> ().referenceResolution;
        this.resolution.y -= 3;

        if (this.font == null) {
            this.font = Resources.GetBuiltinResource<Font> ("Arial.ttf");
        }

        this.roomManager = this.world.GetComponent<RoomManager> ();

        this.CreateMapTexture();
    }

Usage Example

    public void Init(Hashtable changeStateData)
    {
        _gameMode = GameMode.COMBAT;

        _playerCombatSystem = _diContainer.Resolve<PlayerCombatSystem>();
        _buildSystem = _diContainer.Resolve<BuildingSystem>();
        _inventorySystem = _diContainer.Resolve<InventorySystem>();
        _enemySystem = _diContainer.Resolve<EnemySystem>();
        _lootSystem = _diContainer.Resolve<LootSystem>();
        _particleGod = _diContainer.Resolve<ParticleGOD>();
        _monsterGenerator = _diContainer.Resolve<MonsterGenerator>();
        
        Singleton.instance.audioSystem.GenerateAudioLookupForLevel();
        _particleGod.InitParticlePool();

        //HUD
        _hudController = new HUDController(_gameConfig.playerConfig,_gameConfig.hudConfig);
        _hudController.Start(() =>
        {
            _monsterGenerator.Init(_hudController, _playerCombatSystem);
        });

        _playerCombatSystem.Init(_hudController);
        _buildSystem.Init();
        _enemySystem.Init();
        _lootSystem.Init();
        _inventorySystem.Init();

        // Get CombatPlayerView
        //_playerCombatSystem.isEnabled = true;
        _dispatcher.AddListener(GameplayEventType.DAMAGE_TAKEN, onDamageTaken);
        _dispatcher.AddListener(GameplayEventType.GAME_COMPLETE, onGameComplete);
        _dispatcher.AddListener(GameplayEventType.GAME_RETRY, onGameRetry);
    }