예제 #1
0
    public Demon GenerateDemon()
    {
        Demon.Trait one = Demon.TraitList[Random.Range(0, Demon.TraitList.Count)];
        Demon.Trait two = Demon.TraitList[Random.Range(0, Demon.TraitList.Count)];
        while (one == two)
        {
            two = Demon.TraitList[Random.Range(0, Demon.TraitList.Count)];
        }

        Demon NewDemon = new Demon(DemonNames[Random.Range(0, DemonNames.Count)], one, two);

        return(NewDemon);
    }
예제 #2
0
파일: Event.cs 프로젝트: ankanx/LudumDare43
    public void SetDemon(Demon demon, int currentEventNumber)
    {
        DemonNameText.GetComponent <TextMeshProUGUI>().text = demon.Name1;
        DemonName               = demon.Name1;
        DemonMainTrait          = demon.MainTrait1;
        DemonSecondTrait        = demon.SecondTrait1;
        CurrentEventNumber.text = "Choise Number: " + currentEventNumber;
        switch (demon.MainTrait1)
        {
        case Demon.Trait.Envy:
            Trait1.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/envy");
            break;

        case Demon.Trait.Gluttony:
            Trait1.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/gluttony");
            break;

        case Demon.Trait.Greed:
            Trait1.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/greed");
            break;

        case Demon.Trait.Lust:
            Trait1.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/lust");
            break;

        case Demon.Trait.Pride:
            Trait1.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/pride");
            break;

        case Demon.Trait.Sloth:
            Trait1.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/sloth");
            break;

        case Demon.Trait.Wrath:
            Trait1.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/wrath");
            break;
        }

        switch (demon.SecondTrait1)
        {
        case Demon.Trait.Envy:
            Trait2.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/envy");
            break;

        case Demon.Trait.Gluttony:
            Trait2.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/gluttony");
            break;

        case Demon.Trait.Greed:
            Trait2.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/greed");
            break;

        case Demon.Trait.Lust:
            Trait2.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/lust");
            break;

        case Demon.Trait.Pride:
            Trait2.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/pride");
            break;

        case Demon.Trait.Sloth:
            Trait2.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/sloth");
            break;

        case Demon.Trait.Wrath:
            Trait2.GetComponent <Image>().sprite = Resources.Load <Sprite>("SevenSins/wrath");
            break;
        }
    }