Skip to content
Snippets Groups Projects
Commit ed327d25 authored by Jordan's avatar Jordan
Browse files

Character Creation progress

- Body options now array in "CharacterDisplay" Alot easier to set!
- Filled in ChooseCharLook, almost done needs to communicate with
  setAppearance only
parent fcc96722
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using UnityEngine.UI; using UnityEngine.UI;
using System.Collections; using System.Collections;
// This is used for character creation only
public class ChooseCharStats : MonoBehaviour { public class ChooseCharStats : MonoBehaviour {
public Text vitText; public Text vitText;
......
using UnityEngine; using UnityEngine;
using System.Collections; using System.Collections;
// This is used for character creation only
public class ChooseCharLook : MonoBehaviour { public class ChooseCharLook : MonoBehaviour {
// set these in inspector
public Sprite[] headOptions;
public Sprite[] faceOptions;
public Sprite[] legOptions;
public float hue;
private int curHead;
private int curFace;
private int curLegs;
private setAppearance playerLooks;
// note: bodies do not go here, this is character customization
// Use this for initialization
void Start () { void Start () {
playerLooks = GameObject.Find ("CharacterDisplay").GetComponent<setAppearance>(); // Access setAppearance object from characterDisplay
curHead = 0;
curFace = 0;
curLegs = 0;
} }
// Update is called once per frame public void nextFace(){
void Update () { curFace++;
}
public void nextHead(){
curHead++;
}
public void nextLegs(){
curLegs++;
}
public void setHue(){
} }
} }
...@@ -4,16 +4,6 @@ using System.Collections; ...@@ -4,16 +4,6 @@ using System.Collections;
// Made specifically for the player object // Made specifically for the player object
// This is used anywhere ingame aswell as in character creation // This is used anywhere ingame aswell as in character creation
public class setAppearance : MonoBehaviour { public class setAppearance : MonoBehaviour {
// HEADS
public Sprite headOption1; // default
public Sprite headOption2;
// FACES
public Sprite faceOption1; //default
public Sprite faceOption2;
// LEGS
public Sprite legOption1; //default
public Sprite legOption2;
// note: bodies do not go here, this is character customization
private Sprite curFace; private Sprite curFace;
private Sprite curHead; private Sprite curHead;
...@@ -32,21 +22,25 @@ public class setAppearance : MonoBehaviour { ...@@ -32,21 +22,25 @@ public class setAppearance : MonoBehaviour {
head = transform.FindChild("head").gameObject; head = transform.FindChild("head").gameObject;
legR = transform.FindChild("legR").gameObject; legR = transform.FindChild("legR").gameObject;
legL = transform.FindChild("legL").gameObject; legL = transform.FindChild("legL").gameObject;
curFace = faceOption1; update ();
curHead = headOption1;
curLegs = legOption1;
updateAppearance ();
}
// Update is called once per frame
void Update () {
} }
void updateAppearance(){ void update(){
face.GetComponent<SpriteRenderer> ().sprite = curFace; face.GetComponent<SpriteRenderer> ().sprite = curFace;
head.GetComponent<SpriteRenderer> ().sprite = curHead; head.GetComponent<SpriteRenderer> ().sprite = curHead;
legR.GetComponent<SpriteRenderer> ().sprite = curLegs; // two legs, do twice legR.GetComponent<SpriteRenderer> ().sprite = curLegs; // two legs, do twice
legL.GetComponent<SpriteRenderer> ().sprite = curLegs; legL.GetComponent<SpriteRenderer> ().sprite = curLegs;
} }
void setFace(Sprite newFace){
curFace = newFace;
}
void setHead(Sprite newHead){
curHead = newHead;
}
void setLegs(Sprite newLegs){
curLegs = newLegs;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment