Ejemplo n.º 1
0
    public void ChoiceRace()
    {
        string path = "";

        path = animUtils.backBodyName((int)raceSlider.value);

        switch (path)
        {
        case "black":
            mainGameScen = "Ubalib";
            break;

        case "dark":                         //slave
            mainGameScen = "Police";
            break;

        case "darkelf":                         //ethernal
            mainGameScen = "Telkawia";
            break;

        case "light":
            mainGameScen = "Trotlin";
            break;

        case "tanned":
            mainGameScen = "Grunled";
            break;

        case "skeleton":
            mainGameScen = "Police";
            break;

        case "orc":
            mainGameScen = "Mosicowa";
            break;

        case "redorc":
            mainGameScen = "Mosicowa";
            break;

        case "default":
            mainGameScen = "Start";
            break;

        default:
            mainGameScen = "Start";
            break;
        }

        if (path == "darkelf")
        {
            isGhost = true;
        }
        else
        {
            isGhost = false;
        }

        if (!thePlayer.isMan)
        {
            if (path == "skeleton")
            {
                path             = "orc";
                raceSlider.value = (int)AnimationCreaterUtils.enumRace.ORC;
            }
        }
        thePlayer.startPoint = path;
        if (path != "")
        {
            animUtils.loadAnimationClip(path, thePlayer.isMan, "body", "Animation/Character/");

            animUtils.raceEnum = (AnimationCreaterUtils.enumRace)raceSlider.value;
            raceText.text      = animUtils.nameToRace((int)raceSlider.value);

            //raceText.text = animUtils.raceEnum.ToString();

            animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)raceSlider.value, "body", thePlayerAnimator);


            if ((animUtils.raceEnum == AnimationCreaterUtils.enumRace.ORC) || (animUtils.raceEnum == AnimationCreaterUtils.enumRace.REDORC))
            {
                earsSlider.value = earsSlider.maxValue;
                earsSlider.gameObject.SetActive(false);
                //	ChoiceEras();

                eyesSlider.value = eyesSlider.maxValue;
                eyesSlider.gameObject.SetActive(false);
                //	ChoiceEyes();
            }
            else
            {
                earsSlider.gameObject.SetActive(true);
                eyesSlider.gameObject.SetActive(true);
            }
            colorPickerWheel.GetComponent <ColorWheelControl>().Selection = Color.white;
            colorPickerWheel.GetComponent <ColorWheelControl>().PickColor(Color.white);

            if (isGhost)
            {
                body.color   = new Color(body.color.r, body.color.g, body.color.b, 0.4f);
                hair.color   = new Color(hair.color.r, hair.color.g, hair.color.b, 0.4f);
                ears.color   = new Color(ears.color.r, ears.color.g, ears.color.b, 0.4f);
                eyes.color   = new Color(eyes.color.r, eyes.color.g, eyes.color.b, 0.4f);
                nose.color   = new Color(nose.color.r, nose.color.g, nose.color.b, 0.4f);
                facial.color = new Color(facial.color.r, facial.color.g, facial.color.b, 0.4f);
            }
            else
            {
                body.color   = new Color(body.color.r, body.color.g, body.color.b, 1f);
                hair.color   = new Color(hair.color.r, hair.color.g, hair.color.b, 1f);
                ears.color   = new Color(ears.color.r, ears.color.g, ears.color.b, 1f);
                eyes.color   = new Color(eyes.color.r, eyes.color.g, eyes.color.b, 1f);
                nose.color   = new Color(nose.color.r, nose.color.g, nose.color.b, 1f);
                facial.color = new Color(facial.color.r, facial.color.g, facial.color.b, 1f);
            }

            colorChoiceEnum = enumColorChoice.RACE;
        }
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        animUtils      = GetComponent <AnimationCreaterUtils>();
        theNPCAnimator = GetComponent <Animator>();
        string enumHand = "";

        //load body animation
        bodySprite.color = bodyColor;
        if (isMale)
        {
            enumOverrideRace = (AnimationCreaterUtils.enumRace)System.Enum.Parse(typeof(AnimationCreaterUtils.enumRace), enumOverrideRaceMale.ToString());
        }
        else
        {
            enumOverrideRace = (AnimationCreaterUtils.enumRace)System.Enum.Parse(typeof(AnimationCreaterUtils.enumRace), enumOverrideRaceFemale.ToString());
        }
        path = animUtils.backBodyName((int)enumOverrideRace);
        animUtils.loadAnimationClip(path, isMale, "body", "Animation/Character/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideRace, "body", theNPCAnimator);



        //load hair animation
        hairSprite.color = hairColor;
        path             = animUtils.backHairName((int)enumOverrideHair);
        animUtils.loadAnimationClip(path, isMale, "hair", "Animation/Character/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideHair, "hair", theNPCAnimator);



        //load ears animation
        earsSprite.color = earsColor;
        path             = animUtils.backEarsName((int)enumOverrideEars);
        animUtils.loadAnimationClip(path, isMale, "ears", "Animation/Character/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideEars, "ears", theNPCAnimator);

        //load eyes animation
        eyesSprite.color = eyesColor;
        path             = animUtils.backEyesName((int)enumOverrideEyes);
        animUtils.loadAnimationClip(path, isMale, "eyes", "Animation/Character/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideEyes, "eyes", theNPCAnimator);

        //load nose animation
        noseSprite.color = noseColor;
        path             = animUtils.backNoseName((int)enumOverrideNose);
        animUtils.loadAnimationClip(path, isMale, "nose", "Animation/Character/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideNose, "nose", theNPCAnimator);

        //load facialhair aniamtion
        facialSprite.color = facialColor;
        path = animUtils.backFacialName((int)enumOverrideFacial);
        animUtils.loadAnimationClip(path, isMale, "facial", "Animation/Character/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideFacial, "facial", theNPCAnimator);

/////////////////////////////////////items/////////////////////////////

        //load arms aniamtion
        if (isMale)
        {
            enumOverrideArms = (AnimationCreaterUtils.enumArms)System.Enum.Parse(typeof(AnimationCreaterUtils.enumArms), enumOverrideArmsMale.ToString());
        }
        else
        {
            enumOverrideArms = (AnimationCreaterUtils.enumArms)System.Enum.Parse(typeof(AnimationCreaterUtils.enumArms), enumOverrideArmsFemale.ToString());
        }
        armsSprite.color = armsColor;
        path             = animUtils.backArmsName((int)enumOverrideArms);
        animUtils.loadAnimationClip(path, isMale, "arms", "Animation/items/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideArms, "arms", theNPCAnimator);

        //load back aniamtion
        if (isMale)
        {
            enumOverrideBack = (AnimationCreaterUtils.enumBack)System.Enum.Parse(typeof(AnimationCreaterUtils.enumBack), enumOverrideBackMale.ToString());
        }
        else
        {
            enumOverrideBack = (AnimationCreaterUtils.enumBack)System.Enum.Parse(typeof(AnimationCreaterUtils.enumBack), enumOverrideBackFemale.ToString());
        }
        backSprite.color = backColor;
        path             = animUtils.backBackName((int)enumOverrideBack);
        animUtils.loadAnimationClip(path, isMale, "back", "Animation/items/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideBack, "back", theNPCAnimator);

        //load Chest aniamtion
        if (isMale)
        {
            enumOverrideChest = (AnimationCreaterUtils.enumChest)System.Enum.Parse(typeof(AnimationCreaterUtils.enumChest), enumOverrideChestMale.ToString());
        }
        else
        {
            enumOverrideChest = (AnimationCreaterUtils.enumChest)System.Enum.Parse(typeof(AnimationCreaterUtils.enumChest), enumOverrideChestFemale.ToString());
        }
        chestSprite.color = chestColor;
        path = animUtils.backChestName((int)enumOverrideChest);
        animUtils.loadAnimationClip(path, isMale, "chest", "Animation/items/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideChest, "chest", theNPCAnimator);

        //load Feet aniamtion
        if (isMale)
        {
            enumOverrideFeet = (AnimationCreaterUtils.enumFeet)System.Enum.Parse(typeof(AnimationCreaterUtils.enumFeet), enumOverrideFeetMale.ToString());
        }
        else
        {
            enumOverrideFeet = (AnimationCreaterUtils.enumFeet)System.Enum.Parse(typeof(AnimationCreaterUtils.enumFeet), enumOverrideFeetFemale.ToString());
        }
        feetSprite.color = feetColor;
        path             = animUtils.backFeetName((int)enumOverrideFeet);
        animUtils.loadAnimationClip(path, isMale, "feet", "Animation/items/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideFeet, "feet", theNPCAnimator);

        //load Hand aniamtion
        if (isMale)
        {
            enumOverrideHand = (AnimationCreaterUtils.enumHand)System.Enum.Parse(typeof(AnimationCreaterUtils.enumHand), enumOverrideHandMale.ToString());
        }
        else
        {
            enumOverrideHand = (AnimationCreaterUtils.enumHand)System.Enum.Parse(typeof(AnimationCreaterUtils.enumHand), enumOverrideHandFemale.ToString());
        }
        handSprite.color = handColor;
        path             = animUtils.backHandName((int)enumOverrideHand);
        animUtils.loadAnimationClip(path, isMale, "hand", "Animation/items/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideHand, "hand", theNPCAnimator);

        //load Head aniamtion
        if (isMale)
        {
            enumOverrideHead = (AnimationCreaterUtils.enumHead)System.Enum.Parse(typeof(AnimationCreaterUtils.enumHead), enumOverrideHeadMale.ToString());
        }
        else
        {
            enumOverrideHead = (AnimationCreaterUtils.enumHead)System.Enum.Parse(typeof(AnimationCreaterUtils.enumHead), enumOverrideHeadFemale.ToString());
        }
        headSprite.color = headColor;
        path             = animUtils.backHeadName((int)enumOverrideHead);
        animUtils.loadAnimationClip(path, isMale, "head", "Animation/items/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideHead, "head", theNPCAnimator);

        //load Legs aniamtion
        if (isMale)
        {
            enumOverrideLegs = (AnimationCreaterUtils.enumLegs)System.Enum.Parse(typeof(AnimationCreaterUtils.enumLegs), enumOverrideLegsMale.ToString());
        }
        else
        {
            enumOverrideLegs = (AnimationCreaterUtils.enumLegs)System.Enum.Parse(typeof(AnimationCreaterUtils.enumLegs), enumOverrideLegsFemale.ToString());
        }
        legsSprite.color = legsColor;
        path             = animUtils.backLegsName((int)enumOverrideLegs);
        animUtils.loadAnimationClip(path, isMale, "legs", "Animation/items/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideLegs, "legs", theNPCAnimator);

        //load Neck aniamtion
        if (isMale)
        {
            enumOverrideNeck = (AnimationCreaterUtils.enumNeck)System.Enum.Parse(typeof(AnimationCreaterUtils.enumNeck), enumOverrideNeckMale.ToString());
        }
        else
        {
            enumOverrideNeck = (AnimationCreaterUtils.enumNeck)System.Enum.Parse(typeof(AnimationCreaterUtils.enumNeck), enumOverrideNeckFemale.ToString());
        }
        neckSprite.color = neckColor;
        path             = animUtils.backNeckName((int)enumOverrideNeck);
        animUtils.loadAnimationClip(path, isMale, "neck", "Animation/items/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideNeck, "neck", theNPCAnimator);


        //load Waist aniamtion
        if (isMale)
        {
            enumOverrideWaist = (AnimationCreaterUtils.enumWaist)System.Enum.Parse(typeof(AnimationCreaterUtils.enumWaist), enumOverrideWaistMale.ToString());
        }
        else
        {
            enumOverrideWaist = (AnimationCreaterUtils.enumWaist)System.Enum.Parse(typeof(AnimationCreaterUtils.enumWaist), enumOverrideWaistFemale.ToString());
        }
        waistSprite.color = waistColor;
        path = animUtils.backWaistName((int)enumOverrideWaist);
        animUtils.loadAnimationClip(path, isMale, "waist", "Animation/items/");
        animUtils.customizeAnimationSet(animUtils.arrayOneObjectAnimationHandler, (int)enumOverrideWaist, "waist", theNPCAnimator);
    }