KochamMaslo

DisplayCreatePlayerFunctions:

Sep 11th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.91 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class DisplayCreatePlayerFunctions {
  5.  
  6.     private StatAllocationModule statAllocationModule = new StatAllocationModule();
  7.  
  8.     private int classSelection;
  9.     private string[] classSelectionNames = new string[] {"Mag", "Wojownik", "Łotrzyk", "Łucznik", "Czarodziej", "Paladyn"};
  10.  
  11.  
  12.     public void DisplayClassSelections(){
  13.         //A list of toggle buttons and each button will be a different class
  14.         //selection grid
  15.         classSelection = GUI.SelectionGrid(new Rect(50,50,250,300), classSelection, classSelectionNames, 2);
  16.         GUI.Label (new Rect (450, 50, 300, 300), FindClassDescription (classSelection));
  17.         GUI.Label (new Rect (450, 100, 300, 300), FindClassStatValues (classSelection));
  18.     }
  19.  
  20.     private string FindClassDescription(int classSelection){
  21.         if (classSelection == 0) {
  22.             BaseCharacterClass tempClass = new BaseMageClass ();
  23.             return tempClass.CharacterClassDescription;
  24.         } else if (classSelection == 1) {
  25.             BaseCharacterClass tempClass = new BaseWarriorClass ();
  26.             return tempClass.CharacterClassDescription;
  27.         } else if (classSelection == 2) {
  28.             BaseCharacterClass tempClass = new BaseRogueClass ();
  29.             return tempClass.CharacterClassDescription;
  30.         } else if (classSelection == 3) {
  31.             BaseCharacterClass tempClass = new BaseArcherClass ();
  32.             return tempClass.CharacterClassDescription;
  33.         } else if (classSelection == 4) {
  34.             BaseCharacterClass tempClass = new BaseWarlockClass ();
  35.             return tempClass.CharacterClassDescription;
  36.         } else if (classSelection == 5) {
  37.             BaseCharacterClass tempClass = new BasePaladinClass ();
  38.             return tempClass.CharacterClassDescription;
  39.         }
  40.         return "NIE ZNALEZIONO KLASY.";
  41.     }
  42.  
  43.     private string FindClassStatValues(int classSelection){
  44.         if (classSelection == 0) {
  45.             BaseCharacterClass tempClass = new BaseMageClass ();
  46.             string tempStats = "Stamina " + tempClass.Stamina + "\n," + "Wytrzymałość " + tempClass.Endurance + "\n" + "Intelekt " + tempClass.Intellect + "\n" + "Siła " + tempClass.Strength + "\n" + "Zwinność " + tempClass.Agility + "\n" + "Odporność " + tempClass.Resistance;
  47.             return tempStats;
  48.         } else if (classSelection == 1) {
  49.             BaseCharacterClass tempClass = new BaseWarriorClass ();
  50.             string tempStats = "Stamina " + tempClass.Stamina + "\n," + "Wytrzymałość " + tempClass.Endurance + "\n" + "Intelekt " + tempClass.Intellect + "\n" + "Siła " + tempClass.Strength + "\n" + "Zwinność " + tempClass.Agility + "\n" + "Odporność " + tempClass.Resistance;
  51.             return tempStats;
  52.         } else if (classSelection == 2) {
  53.             BaseCharacterClass tempClass = new BaseRogueClass ();
  54.             string tempStats = "Stamina " + tempClass.Stamina + "\n," + "Wytrzymałość " + tempClass.Endurance + "\n" + "Intelekt " + tempClass.Intellect + "\n" + "Siła " + tempClass.Strength + "\n" + "Zwinność " + tempClass.Agility + "\n" + "Odporność " + tempClass.Resistance;
  55.             return tempStats;
  56.         } else if (classSelection == 3) {
  57.             BaseCharacterClass tempClass = new BaseArcherClass ();
  58.             string tempStats = "Stamina " + tempClass.Stamina + "\n," + "Wytrzymałość " + tempClass.Endurance + "\n" + "Intelekt " + tempClass.Intellect + "\n" + "Siła " + tempClass.Strength + "\n" + "Zwinność " + tempClass.Agility + "\n" + "Odporność " + tempClass.Resistance;
  59.             return tempStats;
  60.         } else if (classSelection == 4) {
  61.             BaseCharacterClass tempClass = new BaseWarlockClass ();
  62.             string tempStats = "Stamina " + tempClass.Stamina + "\n," + "Wytrzymałość " + tempClass.Endurance + "\n" + "Intelekt " + tempClass.Intellect + "\n" + "Siła " + tempClass.Strength + "\n" + "Zwinność " + tempClass.Agility + "\n" + "Odporność " + tempClass.Resistance;
  63.             return tempStats;
  64.         } else if (classSelection == 5) {
  65.             BaseCharacterClass tempClass = new BasePaladinClass ();
  66.             string tempStats = "Stamina " + tempClass.Stamina + "\n," + "Wytrzymałość " + tempClass.Endurance + "\n" + "Intelekt " + tempClass.Intellect + "\n" + "Siła " + tempClass.Strength + "\n" + "Zwinność " + tempClass.Agility + "\n" + "Odporność " + tempClass.Resistance;
  67.             return tempStats;
  68.         }
  69.         return "NIE ZNALEZIONO STATYSTYKI.";
  70.     }
  71.  
  72.     public void DisplayStatAllocation(){
  73.         //a list of stats with plus and minus buttons to add stats
  74.         //logic to make sure the player cannot add more than stats given
  75.         statAllocationModule.DisplayStatAllocationModule();
  76.     }
  77.  
  78.     public void DisplayFinalSetup(){
  79.         //name
  80.         //add a description to your character, a shor bio
  81.     }
  82.  
  83.     public void DisplayMainItems(){
  84.         Transform player = GameObject.FindGameObjectWithTag ("Player").transform;
  85.         GUI.Label(new Rect(Screen.width/2, 20, 250, 250), "STWÓRZ POSTAĆ");
  86.  
  87.         if (GUI.RepeatButton (new Rect (450, 400, 50, 50), "<<<")) {
  88.             //turn transform tagged as player to the left
  89.             player.Rotate(Vector3.up);
  90.         }
  91.         if (GUI.RepeatButton (new Rect (800, 400, 50, 50), ">>>")) {
  92.             //turn transform tagged as player to the right
  93.             player.Rotate(Vector3.down);
  94.         }
  95.    
  96.     }
  97.  
  98. }
Add Comment
Please, Sign In to add comment