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
Branches master
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
using UnityEngine.UI;
using System.Collections;
// This is used for character creation only
public class ChooseCharStats : MonoBehaviour {
public Text vitText;
......
using UnityEngine;
using System.Collections;
// This is used for character creation only
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 () {
playerLooks = GameObject.Find ("CharacterDisplay").GetComponent<setAppearance>(); // Access setAppearance object from characterDisplay
curHead = 0;
curFace = 0;
curLegs = 0;
}
// Update is called once per frame
void Update () {
public void nextFace(){
curFace++;
}
public void nextHead(){
curHead++;
}
public void nextLegs(){
curLegs++;
}
public void setHue(){
}
}
......@@ -4,16 +4,6 @@ using System.Collections;
// Made specifically for the player object
// This is used anywhere ingame aswell as in character creation
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 curHead;
......@@ -32,21 +22,25 @@ public class setAppearance : MonoBehaviour {
head = transform.FindChild("head").gameObject;
legR = transform.FindChild("legR").gameObject;
legL = transform.FindChild("legL").gameObject;
curFace = faceOption1;
curHead = headOption1;
curLegs = legOption1;
updateAppearance ();
}
// Update is called once per frame
void Update () {
update ();
}
void updateAppearance(){
void update(){
face.GetComponent<SpriteRenderer> ().sprite = curFace;
head.GetComponent<SpriteRenderer> ().sprite = curHead;
legR.GetComponent<SpriteRenderer> ().sprite = curLegs; // two legs, do twice
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