示例#1
0
    // gets the personailty selected by the user depending on the color of the boxes selected --> when the finish button is pressed

    public void getPersonality()
    {
        personalitycreate = createperson.GetComponent <createPersonalitys>();

        if (badcopbutton.image.color.Equals(Color.red))
        {
            personality = personalitycreate.getBadCop();              // sets personality as bad cop
        }
        else if (goodcopbutton.image.color.Equals(Color.red))
        {
            personality = personalitycreate.getGoodCop();             // sets personality as good cop
        }
        else if (smartcopbutton.image.color.Equals(Color.red))
        {
            personality = personalitycreate.getSmartCop();            // sets personality as smart cop
        }
        else if (dumbcopbutton.image.color.Equals(Color.red))
        {
            personality = personalitycreate.getDumbCop();             // sets personality as dumb cop
        }
        else if (trustycopbutton.image.color.Equals(Color.red))
        {
            personality = personalitycreate.getTrustyCop();           // sets personality as trusting cop
        }
        else if (suspicouscopbutton.image.color.Equals(Color.red))
        {
            personality = personalitycreate.getSuspCop();             // sets personality as suspicious cop
        }
    }
示例#2
0
    public void Character_Test() // Set the cop type to good cop and check that you interact as a good cop
    {
        createPersonalitys person1 = new createPersonalitys();

        var values = person1.getGoodCop();

        var cop_name = values.type1();

        Debug.Log(cop_name);

        Assert.AreEqual(cop_name, "Kind"); // The first question option should always be kind when good cop
    }
示例#3
0
    // procedure which sets both the personailtes for the players
    public void setplayers()
    {
        gamemanager.GetComponent <gameManager>().loadName(playe1name.text);
        gamemanager.GetComponent <gameManager>().setplayer2name(playe2name.text);
        createPersonalitys crepateperson = createpersonobj.GetComponent <createPersonalitys>();

        if (current_button1 == bad1)
        {
            gamemanager.GetComponent <gameManager>().loadpersonint(1);
            Personality_player person = crepateperson.getBadCop();
            gamemanager.GetComponent <gameManager>().loadPersonailty(person);
        }
        else if (current_button1 == good1)
        {
            gamemanager.GetComponent <gameManager>().loadpersonint(2);
            Personality_player person = crepateperson.getGoodCop();
            gamemanager.GetComponent <gameManager>().loadPersonailty(person);
        }
        else if (current_button1 == smart1)
        {
            gamemanager.GetComponent <gameManager>().loadpersonint(3);
            Personality_player person = crepateperson.getSmartCop();
            gamemanager.GetComponent <gameManager>().loadPersonailty(person);
        }
        else if (current_button1 == dumb1)
        {
            gamemanager.GetComponent <gameManager>().loadpersonint(4);
            Personality_player person = crepateperson.getDumbCop();
            gamemanager.GetComponent <gameManager>().loadPersonailty(person);
        }
        else if (current_button1 == trust1)
        {
            gamemanager.GetComponent <gameManager>().loadpersonint(5);
            Personality_player person = crepateperson.getTrustyCop();
            gamemanager.GetComponent <gameManager>().loadPersonailty(person);
        }
        else
        {
            gamemanager.GetComponent <gameManager>().loadpersonint(6);
            Personality_player person = crepateperson.getSuspCop();
            gamemanager.GetComponent <gameManager>().loadPersonailty(person);
        }

        if (current_button2 == bad2)
        {
            gamemanager.GetComponent <gameManager>().setplayer2personint(1);
            Personality_player person = crepateperson.getBadCop();
            gamemanager.GetComponent <gameManager>().loadpersonilty2(person);
        }
        else if (current_button2 == good2)
        {
            gamemanager.GetComponent <gameManager>().setplayer2personint(2);
            Personality_player person = crepateperson.getGoodCop();
            gamemanager.GetComponent <gameManager>().loadpersonilty2(person);
        }
        else if (current_button2 == smart2)
        {
            gamemanager.GetComponent <gameManager>().setplayer2personint(3);
            Personality_player person = crepateperson.getSmartCop();
            gamemanager.GetComponent <gameManager>().loadpersonilty2(person);
        }
        else if (current_button2 == dumb2)
        {
            gamemanager.GetComponent <gameManager>().setplayer2personint(4);
            Personality_player person = crepateperson.getDumbCop();
            gamemanager.GetComponent <gameManager>().loadpersonilty2(person);
        }
        else if (current_button2 == trust2)
        {
            gamemanager.GetComponent <gameManager>().setplayer2personint(5);
            Personality_player person = crepateperson.getTrustyCop();
            gamemanager.GetComponent <gameManager>().loadpersonilty2(person);
        }
        else
        {
            gamemanager.GetComponent <gameManager>().setplayer2personint(6);
            Personality_player person = crepateperson.getSuspCop();
            gamemanager.GetComponent <gameManager>().loadpersonilty2(person);
        }
    }