Example #1
0
    private void Start()
    {
        // load local resources
        // (moving all logic from start function to this first time function)
        gameDataSaver = GetComponent <GameDataSaver>();
        logoutButton.onClick.AddListener(onLogout);
        exitButton.onClick.AddListener(onExit);
        logoutCanvas     = FindObjectOfType <LogoutCanvas>();
        questWindowUI    = FindObjectOfType <QuestWindowUI>();
        reviveController = FindObjectOfType <ReviveController>();
        hud              = FindObjectOfType <HUDController>();
        dialogueUI       = FindObjectOfType <DialogueUI>();
        actionBar        = GetComponentInChildren <ActionBarController>();
        inventoryManager = gameObject.GetComponentInChildren <InventoryManager>(true);
        inventory        = inventoryManager.inventory;
        equipment        = gameObject.GetComponentInChildren <EquipmentPanel>(true).equipment;

        // set up component
        logoutCanvas.gameObject.SetActive(false);
        hud.gameObject.SetActive(false);
        QuestManager.instance.questWindowUI = questWindowUI;
        DialogueManager.instance.dialogueUI = dialogueUI;
        StartCoroutine(LoadGameScene());
        exitButton.enabled = false;
        logoutButton.gameObject.SetActive(false);
        exitButton.gameObject.SetActive(false);

        // If game data exists in the database
        // Override the first stats load using the user data
        if (User.GetActiveCharacter().GameState.isDirty)
        {
            GameCharacter.Stats = GameCharacter.GetStatsFromData(UserService.Instance.User.GetActiveCharacter().GameState.Stats);
            GameCharacter.Stats.Setup();
        }
    }
        private ActionBarView getActionBar()
        {
            var ret = new ActionBarController().Initialize();

            mViewModel.ActionBar = ret;
            return(ret);
        }
    virtual public void Interact()
    {
        this.player.LockMovement();
        this.actionBar.SetActive(true);
        ActionBarController actionBarController = this.actionBar.GetComponent <ActionBarController>();

        actionBarController.interactable = this;
    }
Example #4
0
 void Awake()
 {
     actionBars = FindObjectOfType <ActionBarController>();
     bagList    = new Item[bagSize];
     InputEventManager.OnActionBarPress += SwapActiveAction;
     InputEventManager.OnScrollWheel    += ScrollInventory;
     SetInventory();
     SwapActiveAction(this, 0);
 }