Exemplo n.º 1
0
    // Gets called when clciking a certain faction to play as
    public void FactionSelection(Button button)
    {
        ToggleFactionButton();
        selectedFactionButton = button;
        ToggleFactionButton();
        FactionData tempSelectedData = FactionData.LoadJSON(button.GetComponentInChildren <Text>().text + ".json");

        selectedFactionImage.sprite            = tempSelectedData.playerPortrait;
        selectedCharacterName.text             = tempSelectedData.playerName;
        selectedCharacterVoice.text            = tempSelectedData.voiceNames[tempSelectedData.voice];
        selectedFactionName.text               = tempSelectedData.factionName;
        selectedFactionFoodType.text           = tempSelectedData.foodName[tempSelectedData.style];
        selectedFactionAbility.text            = tempSelectedData.attributeNames[tempSelectedData.attribute];
        selectedFactionAbilityDescription.text = tempSelectedData.attributeDefinitions[tempSelectedData.attribute];
    }
Exemplo n.º 2
0
    //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ TRAITS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

    /*public void QualityChef()
     * {
     *  //traitSelect.text = "Quality Chefs";
     *  qualityChefs.SetActive(true);
     *  managerAlwaysRight.SetActive(false);
     *  flavorTown.SetActive(false);
     *  cheapProduce.SetActive(false);
     *  cheapLabor.SetActive(false);
     *  customerService.SetActive(false);
     *  socialExperiment.SetActive(false);
     *  //play sounds?
     *  AudioManager.GetComponent<AudioManager>().PlayMenuSelectMid();
     *
     * }
     *
     * public void ManagerAlwaysRight()
     * {
     *  //traitSelect.text = "The Manager's Always right!";
     *  qualityChefs.SetActive(false);
     *  managerAlwaysRight.SetActive(true);
     *  flavorTown.SetActive(false);
     *  cheapProduce.SetActive(false);
     *  cheapLabor.SetActive(false);
     *  customerService.SetActive(false);
     *  socialExperiment.SetActive(false);
     *  //play sounds?
     *  AudioManager.GetComponent<AudioManager>().PlayMenuSelectMid();
     * }
     *
     * public void FlavorTown()
     * {
     *  //traitSelect.text = "FlavorKingdom";
     *  qualityChefs.SetActive(false);
     *  managerAlwaysRight.SetActive(false);
     *  flavorTown.SetActive(true);
     *  cheapProduce.SetActive(false);
     *  cheapLabor.SetActive(false);
     *  customerService.SetActive(false);
     *  socialExperiment.SetActive(false);
     *  //play sounds?
     *  AudioManager.GetComponent<AudioManager>().PlayMenuSelectMid();
     * }
     *
     * public void CheapProduce()
     * {
     *  //traitSelect.text = "Cheap Produce";
     *  qualityChefs.SetActive(false);
     *  managerAlwaysRight.SetActive(false);
     *  flavorTown.SetActive(false);
     *  cheapProduce.SetActive(true);
     *  cheapLabor.SetActive(false);
     *  customerService.SetActive(false);
     *  socialExperiment.SetActive(false);
     *  //play sounds?
     *  AudioManager.GetComponent<AudioManager>().PlayMenuSelectMid();
     * }
     *
     * public void CheapLabor()
     * {
     *  //traitSelect.text = "Cheap Labor";
     *  qualityChefs.SetActive(false);
     *  managerAlwaysRight.SetActive(false);
     *  flavorTown.SetActive(false);
     *  cheapProduce.SetActive(false);
     *  cheapLabor.SetActive(true);
     *  customerService.SetActive(false);
     *  socialExperiment.SetActive(false);
     *  //play sounds?
     *  AudioManager.GetComponent<AudioManager>().PlayMenuSelectMid();
     * }
     *
     * public void CustomerService()
     * {
     *  //traitSelect.text = "Customer Service";
     *  qualityChefs.SetActive(false);
     *  managerAlwaysRight.SetActive(false);
     *  flavorTown.SetActive(false);
     *  cheapProduce.SetActive(false);
     *  cheapLabor.SetActive(false);
     *  customerService.SetActive(true);
     *  socialExperiment.SetActive(false);
     *  //play sounds?
     *  AudioManager.GetComponent<AudioManager>().PlayMenuSelectMid();
     * }
     *
     * public void SocialExperiment()
     * {
     *  //traitSelect.text = "Social Experiment";
     *  qualityChefs.SetActive(false);
     *  managerAlwaysRight.SetActive(false);
     *  flavorTown.SetActive(false);
     *  cheapProduce.SetActive(false);
     *  cheapLabor.SetActive(false);
     *  customerService.SetActive(false);
     *  socialExperiment.SetActive(true);
     *  //play sounds?
     *  AudioManager.GetComponent<AudioManager>().PlayMenuSelectMid();
     * }*/

    // \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ FACTION CREATION \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    public void FactionConfirmation()
    {
        try
        {
            if (selectedFactionButton != null)
            {
                string name = selectedFactionButton.GetComponentInChildren <Text>().text;
                //Debug.Log("In FactionUI we are setting the faction of " + name + " to the player");
                currentFaction = FactionData.LoadJSON(name + ".json");
                Debug.Log("We are working with " + currentFaction.factionName + " faction. Lets give it to player " + (whichPlayer + 1));
                GameController.Instance().player[whichPlayer].playerFaction = currentFaction;
                whichPlayer += 1; // go up by one to set whichPlayer back to non index form
                Debug.Log("Player has a faction");
                TurnOnPlease();
                ResetFactionToggles();

                switch (whichPlayer)
                {
                case 1:     // pick 2 player panel
                    AttachPortrait(playerOnePanel.transform);
                    break;

                case 2:     // pick 3 player panel
                    AttachPortrait(playerTwoPanel.transform);
                    break;

                case 3:     // pick 4 player panel
                    AttachPortrait(playerThreePanel.transform);
                    break;

                case 4:
                    AttachPortrait(playerFourPanel.transform);;
                    break;
                }
            }
        }
        catch (System.Exception e)
        {
            throw e;
        }
        ResetFactionCreation();
    }