Ejemplo n.º 1
0
    private void Awake()
    {
        windowLeftObject   = GameObject.Find("WindowLeft");
        windowRightObject  = GameObject.Find("WindowRight");
        playerWindowObject = GameObject.Find("Player1Window");
        diceObject         = GameObject.Find("Dice");
        playerWindow       = playerWindowObject.GetComponent <Window>();
        windowLeft         = windowLeftObject.GetComponent <Window>();
        windowRight        = windowRightObject.GetComponent <Window>();
        dice = diceObject.GetComponent <Dice>();

        playerObject = GameObject.Find("Player1");
        player       = playerObject.GetComponent <Player>();

        tableObject = GameObject.Find("Table");
        table       = tableObject.GetComponent <Table>();

        titleObject = GameObject.Find("Title");
        title       = titleObject.GetComponent <Text>();

        totalScoreTextObject = GameObject.Find("TotalScoreText");
        totalScoreObject     = GameObject.Find("TotalScore");
        totalScoreTxt        = totalScoreObject.GetComponent <Text>();

        textPlayerObject = GameObject.Find("TextPlayerScore");
        textPlayerScore  = textPlayerObject.GetComponent <Text>();

        textGameObject = GameObject.Find("TextGameScore");
        textGameScore  = textGameObject.GetComponent <Text>();


        toolObject = GameObject.Find("Tool");
        tool       = toolObject.GetComponent <Tool>();

        privateObjectiveObject = GameObject.Find("PrivateObjective");
        privateObjective       = privateObjectiveObject.GetComponent <PrivateObjective>();

        publicObjectiveObject = GameObject.Find("PublicObjective");
        publicObjective       = publicObjectiveObject.GetComponent <PublicObjective>();


        roundTrackObject = GameObject.Find("RoundTrack");
        roundTrack       = roundTrackObject.GetComponent <Text>();

        leftWindowButton           = GameObject.Find("ButtonLeft");
        rightWindowButton          = GameObject.Find("ButtonRight");
        draftDiceButton            = GameObject.Find("ButtonDraft");
        showToolsButton            = GameObject.Find("ButtonTools");
        showPrivateObjectiveButton = GameObject.Find("ButtonPrivateObjective");
        showPublicObjectiveButton  = GameObject.Find("ButtonPublicObjective");
        toolBackground             = GameObject.Find("ToolBackground");
        privateBackground          = GameObject.Find("PrivateBackground");
        publicBackground           = GameObject.Find("PublicBackground");
        panelGameOver = GameObject.Find("PanelGameOver");
    }
Ejemplo n.º 2
0
    public void generatePublicObjective()
    {
        int numberOfCards = 2;

        for (int i = 0; i < numberOfCards; i++)
        {
            int             index       = UnityEngine.Random.Range(0, 10);
            PublicObjective createdTool = Instantiate(publicObjective) as PublicObjective;
            createdTool.setFront(index);
            createdTool.tag = "PublicObjective";
            Debug.Log("Generated public objective");
            generatedPublicObjectives.Add(createdTool);
        }
    }
Ejemplo n.º 3
0
    public void showPublicObiective(string arrow)
    {
        showToolsButton.SetActive(false);
        showPrivateObjectiveButton.SetActive(false);
        showPublicObjectiveButton.SetActive(false);
        publicBackground.transform.position = new Vector3(0, 0, -1);
        if (arrow.Equals("left"))
        {
            if (currentPublic > 0)
            {
                currentPublic--;
            }
        }
        else if (arrow.Equals("right"))
        {
            if (currentPublic < generatedPublicObjectives.Count - 1)
            {
                currentPublic++;
            }
        }

        for (int i = 0; i < generatedPublicObjectives.Count; i++)
        {
            if (currentPublic == i)
            {
                generatedPublicObjectives[i].transform.position = new Vector3(0, 0, -1);
                generatedPublicObjectives[i].isShowing          = true;
                showingPublicObjective = generatedPublicObjectives[i];
            }
            else
            {
                generatedPublicObjectives[i].transform.position = new Vector3(-20, 0, -1);
                generatedPublicObjectives[i].isShowing          = false;
            }
        }
    }