void Start()
    {
        master = this.GetComponentInParent <GameMasterController>();
        ui     = master.user_interface_controller;

        audio_source = this.gameObject.AddComponent <AudioSource>();
    }
    private void Awake()
    {
        DontDestroyOnLoad(this.gameObject);

        Cursor.lockState = CursorLockMode.Locked;

        game_state = GameState.MainMenu;
        game_state_change_event_args            = new GameStateChangeEventArgs();
        game_state_change_event_args.game_state = game_state;

        load_level_controller     = this.gameObject.AddComponent <GameLoadLevelController>();
        input_controller          = this.gameObject.GetComponent <GameInputController>();
        audio_controller          = this.gameObject.GetComponent <GameAudioController>();
        player_controller         = this.gameObject.GetComponent <GamePlayerController>();
        data_controller           = this.gameObject.GetComponent <GameDataController>();
        cutscene_controller       = this.gameObject.GetComponent <GameCutsceneController>();
        user_interface_controller = this.gameObject.GetComponent <GameUserInterfaceController>();
    }
    // Start is called before the first frame update
    void Start()
    {
        master = this.GetComponentInParent <GameMasterController>();
        ui     = master.user_interface_controller;

        ui_font = Resources.Load(GameConstants.DIRECTORY_FONT) as Font;

        player_health_icon_texture = Resources.Load("texture/ui/tmenu_player_health") as Texture2D;
        player_health_icon_rect    = new Rect(64, 64, 64, 64);

        ui_style                  = new GUIStyle();
        ui_style.font             = ui_font;
        ui_style.fontSize         = 32;
        ui_style.normal.textColor = Color.white;

        ui_shadow_style                  = new GUIStyle();
        ui_shadow_style.font             = ui_font;
        ui_shadow_style.fontSize         = 32;
        ui_shadow_style.normal.textColor = Color.black;
    }
Beispiel #4
0
 void Start()
 {
     master = this.GetComponentInParent <GameMasterController>();
     ui     = master.user_interface_controller;
 }