Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- #region Gender Class
- public static class Gender
- {
- private static int male = 1;
- private static int female = 0;
- public static int Male()
- {
- return male;
- }
- public static int Female()
- {
- return female;
- }
- }
- #endregion
- #region Body Parts Return Class
- public class BodyPart
- {
- public static string Head(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "maleHead";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleHead";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Arms(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "maleArms";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleArms";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Legs(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "maleLegs";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleLegs";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Torso(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "maleTorso";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleTorso";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Hands(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "maleHands";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleHands";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Feet(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "maleFeet";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleFeet";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Ears(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "maleEars";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleEars";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Mouth(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "maleMouth";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleMouth";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Eyes(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "maleEyes";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleEyes";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- public static string Tongue(int genderID)
- {
- if (genderID == Gender.Male())
- {
- return "maleTongue";
- }
- else if (genderID == Gender.Female())
- {
- return "femaleTongue";
- }
- else
- {
- return "If you see this there is no gender of this person.";
- }
- }
- }
- #endregion
- #region Skin Color Class
- public static class SkinColor
- {
- private static int caucasian = 0;
- private static int black = 1;
- private static int brown = 2;
- private static int arabian = 3;
- private static int oriental = 4;
- private static int pale = 5;
- public static int Caucasian()
- {
- return caucasian;
- }
- public static int Black()
- {
- return black;
- }
- public static int Brown()
- {
- return brown;
- }
- public static int Arabian()
- {
- return arabian;
- }
- public static int Oriental()
- {
- return oriental;
- }
- public static int Pale()
- {
- return pale;
- }
- //etc etc
- }
- #endregion
- #region Skin Color Return Material Class
- public static class SkinMaterial
- {
- public static string get(int skinID)
- {
- if (skinID == SkinColor.Caucasian())
- {
- return "whiteSkin";
- }
- else if (skinID == SkinColor.Arabian())
- {
- return "bronzeSkin";
- }
- else if (skinID == SkinColor.Oriental())
- {
- return "asianSkin";
- }
- else if (skinID == SkinColor.Black())
- {
- return "blackSkin";
- }
- else if (skinID == SkinColor.Brown())
- {
- return "brownSkin";
- }
- else if (skinID == SkinColor.Pale())
- {
- return "snowSkin";
- }
- else
- {
- return "If you see this there is an improper skin id for this person.";
- }
- }
- }
- #endregion
- #region Eye Color Class
- public static class EyeColor
- {
- private static int black = 0;
- private static int brown = 1;
- private static int blue = 2;
- private static int cyan = 3;
- private static int lightBrown = 4;
- private static int yellow = 5;
- private static int red = 6;
- private static int purple = 6;
- private static int orange = 8;
- private static int white = 9;
- public static int Black()
- {
- return black;
- }
- public static int Brown()
- {
- return brown;
- }
- public static int Blue()
- {
- return blue;
- }
- public static int Cyan()
- {
- return cyan;
- }
- public static int LightBrown()
- {
- return lightBrown;
- }
- public static int Yellow()
- {
- return yellow;
- }
- public static int Red()
- {
- return red;
- }
- public static int Purple()
- {
- return purple;
- }
- public static int Orange()
- {
- return orange;
- }
- public static int White()
- {
- return white;
- }
- }
- #endregion
- #region Eye Color Return Material Class
- public static class EyeMaterial
- {
- public static string get(int eyeID)
- {
- if (eyeID == EyeColor.Black())
- {
- return "blackEyes";
- }
- else if (eyeID == EyeColor.Blue())
- {
- return "blueEyes";
- }
- else if (eyeID == EyeColor.Brown())
- {
- return "brownEyes";
- }
- else if (eyeID == EyeColor.Cyan())
- {
- return "cyanEyes";
- }
- else if (eyeID == EyeColor.LightBrown())
- {
- return "lightBrownEyes";
- }
- else if (eyeID == EyeColor.Orange())
- {
- return "orangeEyes";
- }
- else if (eyeID == EyeColor.Purple())
- {
- return "purpleEyes";
- }
- else if (eyeID == EyeColor.Red())
- {
- return "redEyes";
- }
- else if (eyeID == EyeColor.White())
- {
- return "whiteEyes";
- }
- else if (eyeID == EyeColor.Yellow())
- {
- return "yellowEyes";
- }
- else
- {
- return "If you see this there is an error getting a materal for someone's eyes!";
- }
- }
- }
- #endregion
- #region Hair Color Class
- public static class HairColor
- {
- private static int white = 0;
- private static int red = 1;
- private static int black = 2;
- private static int blond = 3;
- private static int brown = 4;
- private static int lightBrown = 5;
- //etc etc
- }
- #endregion
- #region Item Classes
- public static class EqupipableID
- {
- //to be filled with items
- }
- public class Equipable
- {
- //this is for what slot the item is equipable in, if it is equpipable. These are the slots.
- /*
- * 0 = no slot/not equipable
- * 1 = right hand
- * 2 = left hand
- * 3 = ammo
- * 4 = feet
- * 5 = feet&legs
- * 6 = legs
- * 7 = torso
- * 8 = torso&arms
- * 9 = torso&legs&arms
- * 10 = arms
- * 11 = hands
- * 12 = hands&arms
- * 14 = head
- * 14 = finger
- * 15 = neck
- */
- private int slot;
- //item id
- private int ID;
- private int damageType;
- //etc will finish later
- }
- #endregion
- public class Person {
- public GameObject person = new GameObject();
- //this is a value that increments with each new person in the current scene. it is used to differentiate between them.
- private static int personID_no = 0;
- private int personID;
- //this is where the gender value is stored (call using Gender.male or Gender.female)
- private int gender;
- //this is where the skin color is stored (call using SkinColor.Caucasian etc)
- private int skinColor;
- //eye color (EyeColor.brown etc)
- private int eyeColor;
- //hair color (HairColor.brown etc)
- private int hairColor;
- //hair style (HairStyle.shaved etc)
- private int hairStyle;
- //item slots
- private int[] slots = new int[16];
- //start location
- private GameObject spawner;
- //storage
- private GameObject head;
- private GameObject ears;
- private GameObject mouth;
- private GameObject arms;
- private GameObject hands;
- private GameObject feet;
- private GameObject legs;
- private GameObject tongue;
- private GameObject eyes;
- private GameObject torso;
- private GameObject Person_cur;
- private GameObject headPrefab;
- private GameObject earsPrefab;
- private GameObject mouthPrefab;
- private GameObject armsPrefab;
- private GameObject handsPrefab;
- private GameObject feetPrefab;
- private GameObject legsPrefab;
- private GameObject tonguePrefab;
- private GameObject eyesPrefab;
- private GameObject torsoPrefab;
- private GameObject[] slotObjects = new GameObject[16];
- private GameObject[] slotObjectsPrefabs = new GameObject[16];
- //building variables
- private Material eyeMaterial;
- private Material skinMaterial;
- private Material tongueMaterial;
- private Material mouthMaterial;
- private string headString;
- private string eyeString;
- private string tongueString;
- private string mouthString;
- private string armsString;
- private string legsString;
- private string earString;
- private string handString;
- private string torsoString;
- private string feetString;
- /////////////////////////////////////////////////////////////////////////////
- //CONSTRUCTORS
- /////////////////////////////////////////////////////////////////////////////
- public Person(int gender, int skinColor, int eyeColor, int hairColor, int hairStyle, int slot0, int slot1, int slot2, int slot3,
- int slot4, int slot5, int slot6, int slot7, int slot8, int slot9, int slot10, int slot11, int slot12, int slot13, int slot14, int slot15, GameObject spawner)
- {
- personID = personID_no;
- personID_no++;
- this.gender = gender;
- this.skinColor = skinColor;
- this.eyeColor = eyeColor;
- this.hairColor = hairColor;
- this.hairStyle = hairStyle;
- slots[0] = slot0;
- slots[1] = slot1;
- slots[2] = slot2;
- slots[3] = slot3;
- slots[4] = slot4;
- slots[5] = slot5;
- slots[6] = slot6;
- slots[7] = slot7;
- slots[8] = slot8;
- slots[9] = slot9;
- slots[10] = slot10;
- slots[11] = slot11;
- slots[12] = slot12;
- slots[13] = slot13;
- slots[14] = slot14;
- slots[15] = slot15;
- this.spawner = spawner;
- //first lets get the mats sorted
- eyeMaterial = (Material)Resources.Load("Materials/Eyes/" + EyeMaterial.get(eyeColor), typeof(Material));
- skinMaterial = (Material)Resources.Load("Materials/Skin/" + SkinMaterial.get(skinColor), typeof(Material));
- tongueMaterial = (Material)Resources.Load("Materials/Skin/tongue", typeof(Material));
- mouthMaterial = (Material)Resources.Load("Materials/Mouth/mouth", typeof(Material));
- //now lets get the base models sorted
- headString = BodyPart.Head(gender);
- eyeString = BodyPart.Eyes(gender);
- tongueString = BodyPart.Tongue(gender);
- mouthString = BodyPart.Mouth(gender);
- armsString = BodyPart.Arms(gender);
- legsString = BodyPart.Legs(gender);
- earString = BodyPart.Ears(gender);
- handString = BodyPart.Hands(gender);
- torsoString = BodyPart.Torso(gender);
- feetString = BodyPart.Feet(gender);
- ears = (GameObject)Resources.Load(earString, typeof(GameObject));
- head = (GameObject)Resources.Load(headString, typeof(GameObject));
- torso = (GameObject)Resources.Load(torsoString, typeof(GameObject));
- arms = (GameObject)Resources.Load(armsString, typeof(GameObject));
- hands = (GameObject)Resources.Load(handString, typeof(GameObject));
- legs = (GameObject)Resources.Load(legsString, typeof(GameObject));
- feet = (GameObject)Resources.Load(feetString, typeof(GameObject));
- mouth = (GameObject)Resources.Load(mouthString, typeof(GameObject));
- tongue = (GameObject)Resources.Load(tongueString, typeof(GameObject));
- eyes = (GameObject)Resources.Load(eyeString, typeof(GameObject));
- }
- #region Getters
- //getters
- public GameObject getPerson()
- {
- return person;
- }
- public int getSkinColor()
- {
- return skinColor;
- }
- public int getEyeColor()
- {
- return eyeColor;
- }
- public int getHairColor()
- {
- return hairColor;
- }
- public int getHairStyle()
- {
- return hairStyle;
- }
- public int getSlots(int slot_no)
- {
- return slots[slot_no];
- }
- public GameObject getSpawner()
- {
- return spawner;
- }
- public GameObject getHead()
- {
- return head;
- }
- public GameObject getEars()
- {
- return ears;
- }
- public GameObject getMouth()
- {
- return mouth;
- }
- public GameObject getArms()
- {
- return arms;
- }
- public GameObject getHands()
- {
- return hands;
- }
- public GameObject getFeet()
- {
- return feet;
- }
- public GameObject getLegs()
- {
- return legs;
- }
- public GameObject getTongue()
- {
- return tongue;
- }
- public GameObject getEyes()
- {
- return eyes;
- }
- public GameObject getTorso()
- {
- return torso;
- }
- public GameObject getSlotObject(int object_no)
- {
- return slotObjects[object_no];
- }
- public Material getEyeMaterial()
- {
- return eyeMaterial;
- }
- public Material getSkinMaterial()
- {
- return skinMaterial;
- }
- public Material getTongueMaterial()
- {
- return tongueMaterial;
- }
- public Material getMouthMaterial()
- {
- return mouthMaterial;
- }
- public GameObject getHeadPrefab()
- {
- return headPrefab;
- }
- public GameObject getEarsPrefab()
- {
- return earsPrefab;
- }
- public GameObject getMouthPrefab()
- {
- return mouthPrefab;
- }
- public GameObject getArmsPrefab()
- {
- return armsPrefab;
- }
- public GameObject getHandsPrefab()
- {
- return handsPrefab;
- }
- public GameObject getFeetPrefab()
- {
- return feetPrefab;
- }
- public GameObject getLegsPrefab()
- {
- return legsPrefab;
- }
- public GameObject getTonguePrefab()
- {
- return tonguePrefab;
- }
- public GameObject getEyesPrefab()
- {
- return eyesPrefab;
- }
- public GameObject getTorsoPrefab()
- {
- return torsoPrefab;
- }
- public GameObject getPerson_Cur()
- {
- return Person_cur;
- }
- #endregion
- #region Setters
- public void setPerson_Cur(GameObject Person_cur)
- {
- this.Person_cur = Person_cur;
- }
- public void setHead(GameObject head)
- {
- this.head = head;
- }
- public void setEars(GameObject ears)
- {
- this.ears = ears;
- }
- public void setMouth(GameObject mouth)
- {
- this.mouth = mouth;
- }
- public void setArms(GameObject arms)
- {
- this.arms = arms;
- }
- public void setHands(GameObject hands)
- {
- this.hands = hands;
- }
- public void setFeet(GameObject feet)
- {
- this.feet = feet;
- }
- public void setLegs(GameObject legs)
- {
- this.legs = legs;
- }
- public void setTongue(GameObject tongue)
- {
- this.tongue = tongue;
- }
- public void setEyes(GameObject eyes)
- {
- this.eyes = eyes;
- }
- public void setTorso(GameObject torso)
- {
- this.torso = torso;
- }
- public void setHeadPrefab(GameObject headPrefab)
- {
- this.headPrefab = headPrefab;
- }
- public void setEarsPrefab(GameObject earsPrefab)
- {
- this.earsPrefab = earsPrefab;
- }
- public void setMouthPrefab(GameObject mouthPrefab)
- {
- this.mouthPrefab = mouthPrefab;
- }
- public void setArmsPrefab(GameObject armsPrefab)
- {
- this.armsPrefab = armsPrefab;
- }
- public void setHandsPrefab(GameObject handsPrefab)
- {
- this.handsPrefab = handsPrefab;
- }
- public void setFeetPrefab(GameObject feetPrefab)
- {
- this.feetPrefab = feetPrefab;
- }
- public void setLegsPrefab(GameObject legsPrefab)
- {
- this.legsPrefab = legsPrefab;
- }
- public void setTonguePrefab(GameObject tonguePrefab)
- {
- this.tonguePrefab = tonguePrefab;
- }
- public void setEyesPrefab(GameObject eyesPrefab)
- {
- this.eyesPrefab = eyesPrefab;
- }
- public void setTorsoPrefab(GameObject torsoPrefab)
- {
- this.torsoPrefab = torsoPrefab;
- }
- public void setSlotObjects(GameObject slotObject, int slotno)
- {
- slotObjects[slotno] = slotObject;
- }
- public void setSlotObjectPrefabs(GameObject slotObject, int slotno)
- {
- slotObjectsPrefabs[slotno] = slotObject;
- }
- #endregion
- }
Advertisement
Add Comment
Please, Sign In to add comment