public void ChangeClothing()
    {
        if (creator.dca == null)
        {
            return;
        }

        bool male = creator.dca.activeRace.name == "HumanMale" ? true : false;

        creator.SelectClothing(male ? MaleClothingIndex : FemaleClothingIndex);

        if (indexText != null)
        {
            indexText.text = male ? (MaleClothingIndex + 1).ToString() : (FemaleClothingIndex + 1).ToString();
        }
    }
示例#2
0
    public void ChangeClothing()
    {
        if (creator.dca == null)
        {
            return;
        }

        bool male = creator.dca.activeRace.name == "HumanMale" ? true : false;

        if (male)         // Male
        {
            if (increase) // Increase
            {
                if (creator.maleClothingIndex >= creator.maleClothing.Count - 1)
                {
                    creator.maleClothingIndex = 0;
                    index = creator.maleClothingIndex;
                }
                else
                {
                    creator.maleClothingIndex += 1; index = creator.maleClothingIndex;
                }
            }
            if (!increase) // Decrease
            {
                if (creator.maleClothingIndex == 0)
                {
                    creator.maleClothingIndex = creator.maleClothing.Count - 1;
                    index = creator.maleClothingIndex;
                }
                else
                {
                    creator.maleClothingIndex -= 1; index = creator.maleClothingIndex;
                }
            }
        }
        if (!male)        // Female
        {
            if (increase) // Increase
            {
                if (creator.femaleClothingIndex >= creator.femaleClothing.Count - 1)
                {
                    creator.femaleClothingIndex = 0;
                    index = creator.femaleClothingIndex;
                }
                else
                {
                    creator.femaleClothingIndex += 1; index = creator.femaleClothingIndex;
                }
            }
            if (!increase) // Decrease
            {
                if (creator.femaleClothingIndex == 0)
                {
                    creator.femaleClothingIndex = creator.femaleClothing.Count - 1;
                    index = creator.femaleClothingIndex;
                }
                else
                {
                    index = creator.femaleClothingIndex; index = creator.femaleClothingIndex;
                }
            }
        }
        creator.SelectClothing(index);

        if (indexText != null)
        {
            indexText.text = (index + 1).ToString();
        }
    }