Ramaraunt1

Untitled

Dec 21st, 2016
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.93 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. #region Gender Class
  5. public static class Gender
  6. {
  7. private static int male = 1;
  8. private static int female = 0;
  9.  
  10. public static int Male()
  11. {
  12. return male;
  13. }
  14. public static int Female()
  15. {
  16. return female;
  17. }
  18. }
  19. #endregion
  20.  
  21. #region Body Parts Return Class
  22. public class BodyPart
  23. {
  24. public static string Head(int genderID)
  25. {
  26. if (genderID == Gender.Male())
  27. {
  28. return "maleHead";
  29. }
  30. else if (genderID == Gender.Female())
  31. {
  32. return "femaleHead";
  33. }
  34. else
  35. {
  36. return "If you see this there is no gender of this person.";
  37. }
  38. }
  39.  
  40. public static string Arms(int genderID)
  41. {
  42. if (genderID == Gender.Male())
  43. {
  44. return "maleArms";
  45. }
  46. else if (genderID == Gender.Female())
  47. {
  48. return "femaleArms";
  49. }
  50. else
  51. {
  52. return "If you see this there is no gender of this person.";
  53. }
  54. }
  55.  
  56. public static string Legs(int genderID)
  57. {
  58. if (genderID == Gender.Male())
  59. {
  60. return "maleLegs";
  61. }
  62. else if (genderID == Gender.Female())
  63. {
  64. return "femaleLegs";
  65. }
  66. else
  67. {
  68. return "If you see this there is no gender of this person.";
  69. }
  70. }
  71.  
  72. public static string Torso(int genderID)
  73. {
  74. if (genderID == Gender.Male())
  75. {
  76. return "maleTorso";
  77. }
  78. else if (genderID == Gender.Female())
  79. {
  80. return "femaleTorso";
  81. }
  82. else
  83. {
  84. return "If you see this there is no gender of this person.";
  85. }
  86. }
  87.  
  88. public static string Hands(int genderID)
  89. {
  90. if (genderID == Gender.Male())
  91. {
  92. return "maleHands";
  93. }
  94. else if (genderID == Gender.Female())
  95. {
  96. return "femaleHands";
  97. }
  98. else
  99. {
  100. return "If you see this there is no gender of this person.";
  101. }
  102. }
  103.  
  104. public static string Feet(int genderID)
  105. {
  106. if (genderID == Gender.Male())
  107. {
  108. return "maleFeet";
  109. }
  110. else if (genderID == Gender.Female())
  111. {
  112. return "femaleFeet";
  113. }
  114. else
  115. {
  116. return "If you see this there is no gender of this person.";
  117. }
  118. }
  119.  
  120. public static string Ears(int genderID)
  121. {
  122. if (genderID == Gender.Male())
  123. {
  124. return "maleEars";
  125. }
  126. else if (genderID == Gender.Female())
  127. {
  128. return "femaleEars";
  129. }
  130. else
  131. {
  132. return "If you see this there is no gender of this person.";
  133. }
  134. }
  135.  
  136. public static string Mouth(int genderID)
  137. {
  138. if (genderID == Gender.Male())
  139. {
  140. return "maleMouth";
  141. }
  142. else if (genderID == Gender.Female())
  143. {
  144. return "femaleMouth";
  145. }
  146. else
  147. {
  148. return "If you see this there is no gender of this person.";
  149. }
  150. }
  151.  
  152. public static string Eyes(int genderID)
  153. {
  154. if (genderID == Gender.Male())
  155. {
  156. return "maleEyes";
  157. }
  158. else if (genderID == Gender.Female())
  159. {
  160. return "femaleEyes";
  161. }
  162. else
  163. {
  164. return "If you see this there is no gender of this person.";
  165. }
  166. }
  167.  
  168. public static string Tongue(int genderID)
  169. {
  170. if (genderID == Gender.Male())
  171. {
  172. return "maleTongue";
  173. }
  174. else if (genderID == Gender.Female())
  175. {
  176. return "femaleTongue";
  177. }
  178. else
  179. {
  180. return "If you see this there is no gender of this person.";
  181. }
  182. }
  183. }
  184. #endregion
  185.  
  186. #region Skin Color Class
  187. public static class SkinColor
  188. {
  189. private static int caucasian = 0;
  190. private static int black = 1;
  191. private static int brown = 2;
  192. private static int arabian = 3;
  193. private static int oriental = 4;
  194. private static int pale = 5;
  195.  
  196. public static int Caucasian()
  197. {
  198. return caucasian;
  199. }
  200. public static int Black()
  201. {
  202. return black;
  203. }
  204. public static int Brown()
  205. {
  206. return brown;
  207. }
  208. public static int Arabian()
  209. {
  210. return arabian;
  211. }
  212. public static int Oriental()
  213. {
  214. return oriental;
  215. }
  216. public static int Pale()
  217. {
  218. return pale;
  219. }
  220. //etc etc
  221. }
  222. #endregion
  223.  
  224. #region Skin Color Return Material Class
  225. public static class SkinMaterial
  226. {
  227. public static string get(int skinID)
  228. {
  229. if (skinID == SkinColor.Caucasian())
  230. {
  231. return "whiteSkin";
  232. }
  233. else if (skinID == SkinColor.Arabian())
  234. {
  235. return "bronzeSkin";
  236. }
  237. else if (skinID == SkinColor.Oriental())
  238. {
  239. return "asianSkin";
  240. }
  241. else if (skinID == SkinColor.Black())
  242. {
  243. return "blackSkin";
  244. }
  245. else if (skinID == SkinColor.Brown())
  246. {
  247. return "brownSkin";
  248. }
  249. else if (skinID == SkinColor.Pale())
  250. {
  251. return "snowSkin";
  252. }
  253. else
  254. {
  255. return "If you see this there is an improper skin id for this person.";
  256. }
  257. }
  258. }
  259. #endregion
  260.  
  261. #region Eye Color Class
  262. public static class EyeColor
  263. {
  264. private static int black = 0;
  265. private static int brown = 1;
  266. private static int blue = 2;
  267. private static int cyan = 3;
  268. private static int lightBrown = 4;
  269. private static int yellow = 5;
  270. private static int red = 6;
  271. private static int purple = 6;
  272. private static int orange = 8;
  273. private static int white = 9;
  274.  
  275. public static int Black()
  276. {
  277. return black;
  278. }
  279.  
  280. public static int Brown()
  281. {
  282. return brown;
  283. }
  284.  
  285. public static int Blue()
  286. {
  287. return blue;
  288. }
  289.  
  290. public static int Cyan()
  291. {
  292. return cyan;
  293. }
  294.  
  295. public static int LightBrown()
  296. {
  297. return lightBrown;
  298. }
  299.  
  300. public static int Yellow()
  301. {
  302. return yellow;
  303. }
  304.  
  305. public static int Red()
  306. {
  307. return red;
  308. }
  309.  
  310. public static int Purple()
  311. {
  312. return purple;
  313. }
  314.  
  315. public static int Orange()
  316. {
  317. return orange;
  318. }
  319.  
  320. public static int White()
  321. {
  322. return white;
  323. }
  324. }
  325. #endregion
  326.  
  327. #region Eye Color Return Material Class
  328. public static class EyeMaterial
  329. {
  330. public static string get(int eyeID)
  331. {
  332. if (eyeID == EyeColor.Black())
  333. {
  334. return "blackEyes";
  335. }
  336. else if (eyeID == EyeColor.Blue())
  337. {
  338. return "blueEyes";
  339. }
  340. else if (eyeID == EyeColor.Brown())
  341. {
  342. return "brownEyes";
  343. }
  344. else if (eyeID == EyeColor.Cyan())
  345. {
  346. return "cyanEyes";
  347. }
  348. else if (eyeID == EyeColor.LightBrown())
  349. {
  350. return "lightBrownEyes";
  351. }
  352. else if (eyeID == EyeColor.Orange())
  353. {
  354. return "orangeEyes";
  355. }
  356. else if (eyeID == EyeColor.Purple())
  357. {
  358. return "purpleEyes";
  359. }
  360. else if (eyeID == EyeColor.Red())
  361. {
  362. return "redEyes";
  363. }
  364. else if (eyeID == EyeColor.White())
  365. {
  366. return "whiteEyes";
  367. }
  368. else if (eyeID == EyeColor.Yellow())
  369. {
  370. return "yellowEyes";
  371. }
  372. else
  373. {
  374. return "If you see this there is an error getting a materal for someone's eyes!";
  375. }
  376. }
  377. }
  378. #endregion
  379.  
  380. #region Hair Color Class
  381. public static class HairColor
  382. {
  383. private static int white = 0;
  384. private static int red = 1;
  385. private static int black = 2;
  386. private static int blond = 3;
  387. private static int brown = 4;
  388. private static int lightBrown = 5;
  389. //etc etc
  390. }
  391. #endregion
  392.  
  393. #region Item Classes
  394. public static class EqupipableID
  395. {
  396. //to be filled with items
  397. }
  398.  
  399. public class Equipable
  400. {
  401. //this is for what slot the item is equipable in, if it is equpipable. These are the slots.
  402. /*
  403. * 0 = no slot/not equipable
  404. * 1 = right hand
  405. * 2 = left hand
  406. * 3 = ammo
  407. * 4 = feet
  408. * 5 = feet&legs
  409. * 6 = legs
  410. * 7 = torso
  411. * 8 = torso&arms
  412. * 9 = torso&legs&arms
  413. * 10 = arms
  414. * 11 = hands
  415. * 12 = hands&arms
  416. * 14 = head
  417. * 14 = finger
  418. * 15 = neck
  419. */
  420. private int slot;
  421.  
  422. //item id
  423. private int ID;
  424.  
  425. private int damageType;
  426.  
  427. //etc will finish later
  428. }
  429. #endregion
  430.  
  431.  
  432.  
  433. public class Person {
  434.  
  435. public GameObject person = new GameObject();
  436. //this is a value that increments with each new person in the current scene. it is used to differentiate between them.
  437. private static int personID_no = 0;
  438. private int personID;
  439.  
  440. //this is where the gender value is stored (call using Gender.male or Gender.female)
  441. private int gender;
  442.  
  443. //this is where the skin color is stored (call using SkinColor.Caucasian etc)
  444. private int skinColor;
  445.  
  446. //eye color (EyeColor.brown etc)
  447. private int eyeColor;
  448.  
  449. //hair color (HairColor.brown etc)
  450. private int hairColor;
  451.  
  452. //hair style (HairStyle.shaved etc)
  453. private int hairStyle;
  454.  
  455. //item slots
  456. private int[] slots = new int[16];
  457.  
  458. //start location
  459. private GameObject spawner;
  460.  
  461. //storage
  462. private GameObject head;
  463. private GameObject ears;
  464. private GameObject mouth;
  465. private GameObject arms;
  466. private GameObject hands;
  467. private GameObject feet;
  468. private GameObject legs;
  469. private GameObject tongue;
  470. private GameObject eyes;
  471. private GameObject torso;
  472. private GameObject Person_cur;
  473.  
  474. private GameObject headPrefab;
  475. private GameObject earsPrefab;
  476. private GameObject mouthPrefab;
  477. private GameObject armsPrefab;
  478. private GameObject handsPrefab;
  479. private GameObject feetPrefab;
  480. private GameObject legsPrefab;
  481. private GameObject tonguePrefab;
  482. private GameObject eyesPrefab;
  483. private GameObject torsoPrefab;
  484.  
  485. private GameObject[] slotObjects = new GameObject[16];
  486. private GameObject[] slotObjectsPrefabs = new GameObject[16];
  487.  
  488. //building variables
  489. private Material eyeMaterial;
  490. private Material skinMaterial;
  491. private Material tongueMaterial;
  492. private Material mouthMaterial;
  493.  
  494. private string headString;
  495. private string eyeString;
  496. private string tongueString;
  497. private string mouthString;
  498. private string armsString;
  499. private string legsString;
  500. private string earString;
  501. private string handString;
  502. private string torsoString;
  503. private string feetString;
  504.  
  505. /////////////////////////////////////////////////////////////////////////////
  506. //CONSTRUCTORS
  507. /////////////////////////////////////////////////////////////////////////////
  508.  
  509. public Person(int gender, int skinColor, int eyeColor, int hairColor, int hairStyle, int slot0, int slot1, int slot2, int slot3,
  510. 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)
  511. {
  512. personID = personID_no;
  513. personID_no++;
  514.  
  515. this.gender = gender;
  516. this.skinColor = skinColor;
  517. this.eyeColor = eyeColor;
  518. this.hairColor = hairColor;
  519. this.hairStyle = hairStyle;
  520.  
  521. slots[0] = slot0;
  522. slots[1] = slot1;
  523. slots[2] = slot2;
  524. slots[3] = slot3;
  525. slots[4] = slot4;
  526. slots[5] = slot5;
  527. slots[6] = slot6;
  528. slots[7] = slot7;
  529. slots[8] = slot8;
  530. slots[9] = slot9;
  531. slots[10] = slot10;
  532. slots[11] = slot11;
  533. slots[12] = slot12;
  534. slots[13] = slot13;
  535. slots[14] = slot14;
  536. slots[15] = slot15;
  537.  
  538. this.spawner = spawner;
  539.  
  540. //first lets get the mats sorted
  541. eyeMaterial = (Material)Resources.Load("Materials/Eyes/" + EyeMaterial.get(eyeColor), typeof(Material));
  542. skinMaterial = (Material)Resources.Load("Materials/Skin/" + SkinMaterial.get(skinColor), typeof(Material));
  543. tongueMaterial = (Material)Resources.Load("Materials/Skin/tongue", typeof(Material));
  544. mouthMaterial = (Material)Resources.Load("Materials/Mouth/mouth", typeof(Material));
  545.  
  546. //now lets get the base models sorted
  547. headString = BodyPart.Head(gender);
  548. eyeString = BodyPart.Eyes(gender);
  549. tongueString = BodyPart.Tongue(gender);
  550. mouthString = BodyPart.Mouth(gender);
  551. armsString = BodyPart.Arms(gender);
  552. legsString = BodyPart.Legs(gender);
  553. earString = BodyPart.Ears(gender);
  554. handString = BodyPart.Hands(gender);
  555. torsoString = BodyPart.Torso(gender);
  556. feetString = BodyPart.Feet(gender);
  557.  
  558. ears = (GameObject)Resources.Load(earString, typeof(GameObject));
  559. head = (GameObject)Resources.Load(headString, typeof(GameObject));
  560. torso = (GameObject)Resources.Load(torsoString, typeof(GameObject));
  561. arms = (GameObject)Resources.Load(armsString, typeof(GameObject));
  562. hands = (GameObject)Resources.Load(handString, typeof(GameObject));
  563. legs = (GameObject)Resources.Load(legsString, typeof(GameObject));
  564. feet = (GameObject)Resources.Load(feetString, typeof(GameObject));
  565. mouth = (GameObject)Resources.Load(mouthString, typeof(GameObject));
  566. tongue = (GameObject)Resources.Load(tongueString, typeof(GameObject));
  567. eyes = (GameObject)Resources.Load(eyeString, typeof(GameObject));
  568.  
  569.  
  570. }
  571.  
  572. #region Getters
  573. //getters
  574.  
  575. public GameObject getPerson()
  576. {
  577. return person;
  578. }
  579. public int getSkinColor()
  580. {
  581. return skinColor;
  582. }
  583.  
  584. public int getEyeColor()
  585. {
  586. return eyeColor;
  587. }
  588.  
  589. public int getHairColor()
  590. {
  591. return hairColor;
  592. }
  593.  
  594. public int getHairStyle()
  595. {
  596. return hairStyle;
  597. }
  598.  
  599. public int getSlots(int slot_no)
  600. {
  601. return slots[slot_no];
  602. }
  603.  
  604. public GameObject getSpawner()
  605. {
  606. return spawner;
  607. }
  608.  
  609. public GameObject getHead()
  610. {
  611. return head;
  612. }
  613.  
  614. public GameObject getEars()
  615. {
  616. return ears;
  617. }
  618.  
  619. public GameObject getMouth()
  620. {
  621. return mouth;
  622. }
  623.  
  624. public GameObject getArms()
  625. {
  626. return arms;
  627. }
  628.  
  629. public GameObject getHands()
  630. {
  631. return hands;
  632. }
  633.  
  634. public GameObject getFeet()
  635. {
  636. return feet;
  637. }
  638.  
  639. public GameObject getLegs()
  640. {
  641. return legs;
  642. }
  643.  
  644. public GameObject getTongue()
  645. {
  646. return tongue;
  647. }
  648.  
  649. public GameObject getEyes()
  650. {
  651. return eyes;
  652. }
  653.  
  654. public GameObject getTorso()
  655. {
  656. return torso;
  657. }
  658.  
  659. public GameObject getSlotObject(int object_no)
  660. {
  661. return slotObjects[object_no];
  662. }
  663.  
  664. public Material getEyeMaterial()
  665. {
  666. return eyeMaterial;
  667. }
  668.  
  669. public Material getSkinMaterial()
  670. {
  671. return skinMaterial;
  672. }
  673.  
  674. public Material getTongueMaterial()
  675. {
  676. return tongueMaterial;
  677. }
  678.  
  679. public Material getMouthMaterial()
  680. {
  681. return mouthMaterial;
  682. }
  683.  
  684. public GameObject getHeadPrefab()
  685. {
  686. return headPrefab;
  687. }
  688.  
  689. public GameObject getEarsPrefab()
  690. {
  691. return earsPrefab;
  692. }
  693.  
  694. public GameObject getMouthPrefab()
  695. {
  696. return mouthPrefab;
  697. }
  698.  
  699. public GameObject getArmsPrefab()
  700. {
  701. return armsPrefab;
  702. }
  703.  
  704. public GameObject getHandsPrefab()
  705. {
  706. return handsPrefab;
  707. }
  708.  
  709. public GameObject getFeetPrefab()
  710. {
  711. return feetPrefab;
  712. }
  713.  
  714. public GameObject getLegsPrefab()
  715. {
  716. return legsPrefab;
  717. }
  718.  
  719. public GameObject getTonguePrefab()
  720. {
  721. return tonguePrefab;
  722. }
  723.  
  724. public GameObject getEyesPrefab()
  725. {
  726. return eyesPrefab;
  727. }
  728.  
  729. public GameObject getTorsoPrefab()
  730. {
  731. return torsoPrefab;
  732. }
  733.  
  734. public GameObject getPerson_Cur()
  735. {
  736. return Person_cur;
  737. }
  738.  
  739.  
  740. #endregion
  741.  
  742. #region Setters
  743. public void setPerson_Cur(GameObject Person_cur)
  744. {
  745. this.Person_cur = Person_cur;
  746. }
  747.  
  748. public void setHead(GameObject head)
  749. {
  750. this.head = head;
  751. }
  752.  
  753. public void setEars(GameObject ears)
  754. {
  755. this.ears = ears;
  756. }
  757.  
  758. public void setMouth(GameObject mouth)
  759. {
  760. this.mouth = mouth;
  761. }
  762.  
  763. public void setArms(GameObject arms)
  764. {
  765. this.arms = arms;
  766. }
  767.  
  768. public void setHands(GameObject hands)
  769. {
  770. this.hands = hands;
  771. }
  772.  
  773. public void setFeet(GameObject feet)
  774. {
  775. this.feet = feet;
  776. }
  777. public void setLegs(GameObject legs)
  778. {
  779. this.legs = legs;
  780. }
  781.  
  782. public void setTongue(GameObject tongue)
  783. {
  784. this.tongue = tongue;
  785. }
  786.  
  787. public void setEyes(GameObject eyes)
  788. {
  789. this.eyes = eyes;
  790. }
  791.  
  792. public void setTorso(GameObject torso)
  793. {
  794. this.torso = torso;
  795. }
  796.  
  797. public void setHeadPrefab(GameObject headPrefab)
  798. {
  799. this.headPrefab = headPrefab;
  800. }
  801.  
  802. public void setEarsPrefab(GameObject earsPrefab)
  803. {
  804. this.earsPrefab = earsPrefab;
  805. }
  806.  
  807. public void setMouthPrefab(GameObject mouthPrefab)
  808. {
  809. this.mouthPrefab = mouthPrefab;
  810. }
  811.  
  812. public void setArmsPrefab(GameObject armsPrefab)
  813. {
  814. this.armsPrefab = armsPrefab;
  815. }
  816.  
  817. public void setHandsPrefab(GameObject handsPrefab)
  818. {
  819. this.handsPrefab = handsPrefab;
  820. }
  821.  
  822. public void setFeetPrefab(GameObject feetPrefab)
  823. {
  824. this.feetPrefab = feetPrefab;
  825. }
  826. public void setLegsPrefab(GameObject legsPrefab)
  827. {
  828. this.legsPrefab = legsPrefab;
  829. }
  830.  
  831. public void setTonguePrefab(GameObject tonguePrefab)
  832. {
  833. this.tonguePrefab = tonguePrefab;
  834. }
  835.  
  836. public void setEyesPrefab(GameObject eyesPrefab)
  837. {
  838. this.eyesPrefab = eyesPrefab;
  839. }
  840.  
  841. public void setTorsoPrefab(GameObject torsoPrefab)
  842. {
  843. this.torsoPrefab = torsoPrefab;
  844. }
  845.  
  846. public void setSlotObjects(GameObject slotObject, int slotno)
  847. {
  848. slotObjects[slotno] = slotObject;
  849. }
  850.  
  851. public void setSlotObjectPrefabs(GameObject slotObject, int slotno)
  852. {
  853. slotObjectsPrefabs[slotno] = slotObject;
  854. }
  855.  
  856.  
  857.  
  858. #endregion
  859. }
Advertisement
Add Comment
Please, Sign In to add comment