public T AddElement <T>(string labelText, UnityAction call = null) where T : rpUIElement { DBG.Log("Generic Element Added"); rpUIElement elm; switch (typeof(T).ToString()) { case LABEL_TYPE: DBG.Log("Generic rpLabel Created"); elm = Instantiate(refLabel) as rpLabel; ((rpLabel)elm).Text = labelText; break; case BUTTON_TYPE: DBG.Log("Generic rpButton Created"); elm = Instantiate(refButton) as rpButton; ((rpButton)elm).Text = labelText; ((rpButton)elm).OnClick.AddListener(call); break; default: elm = null; break; } elm.Parent = gameObject; elementList.Add(elm); return(elm as T); }
//public rpUIElement AddElement(rpUIElement element, string labelText) //{ // DBG.Log("Base Element Created"); // rpUIElement elm = Instantiate(element) as rpUIElement; // return elm; //} //public rpUIElement AddElement(rpElemType type, string labelText, UnityAction call = null) //{ // switch (type) // { // case rpElemType.LABEL: // return AddLabel(labelText); // case rpElemType.BUTTON: // return AddButton(labelText, call); // default: // return new rpUIElement(); // } //} public rpLabel AddLabel(string labelText) { DBG.Log("Label Created"); rpLabel lbl = Instantiate(refLabel) as rpLabel; lbl.Text = labelText; lbl.Parent = gameObject; elementList.Add(lbl); return(lbl); }
// Init public virtual void init() { DBG.Add(displayName() + " Created", true); makeNewLists(); DBG.Add(displayLevel(), true); if (!DBG.Paused) { DBG.Log(); } setupStats(_level); }
public rpButton AddButton(string labelText, UnityAction call) { DBG.Log("Button Created"); rpButton btn = Instantiate(refButton) as rpButton; btn.Text = labelText; btn.OnClick.AddListener(call); btn.Parent = gameObject; elementList.Add(btn); return(btn); }
public void Start() { DBG.Logging = true; DBG.Log("Player Started"); if (actor) { DBG.Log(actor.name); } else { DBG.Log("No Actor Set"); actor = new rpActor("Blah!", 99); } }
void Start() { DBG.Logging = true; DBG.Pause(); DBG.Log("Test Start"); player1 = new rpPlayer("Main Character", 1); player2 = new rpPlayer("Trusty Sidekick", 1); player3 = new rpPlayer("Shady Antihero", 1); player4 = new rpPlayer("Love Interest", 1); player5 = new rpPlayer("Plucky Child", 1); player6 = new rpPlayer("Brainy Knowitall", 1); player7 = new rpPlayer("Mystic Master", 1); DBG.Unpause(); DBG.Log(); }
void Init() { DBG.Log(this, "Initializing"); if (!canvas) { DBG.Log("Canvas Not Linked. Finding..."); canvas = FindObjectOfType <Canvas>(); if (!canvas) { DBG.Log(new Error().newError(Error.TYPE.UNABLE_TO_LOAD, name, "Canvas Not Found! Aborting")); return; } } DBG.Log("Canvas Found: " + canvas.name); //Parent = canvas.gameObject; ParentCanvas = canvas; DBG.Log("Parent Set: " + Parent.name); rectTransform = (RectTransform)transform; DBG.Log("RectTransform Set: " + rectTransform.name); }
public virtual void setupStats(int level) { DBG.Add("<StatKVList>", true); for (int i = 0; i < numStats; i++) { rpStatType type = (rpStatType)i; switch (type) { case rpStatType.INVALID: case rpStatType.COUNT: break; case rpStatType.LVL: case rpStatType.XP: Stats.AddStat(type, new rpStat(level)); break; case rpStatType.RXP: Stats.AddStat(type, new rpStat(level * 3)); break; case rpStatType.RGLD: Stats.AddStat(type, new rpStat(rollStat(level, level * 100))); break; default: Stats.AddStat(type, new rpStat(rollStat(level))); break; } DBG.Add("[" + type + "]", true); DBG.Add(" : " + Stats[type].Value); //DBG.Add("\n"); } if (!DBG.Paused) { DBG.Log(); } }
public virtual void Start() { DBG.Log(this, "Start"); Init(); }
// Use this for initialization public virtual void Awake() { DBG.Log(this, "Awake"); }
void Init() { DBG.Log(this, "Initializing"); //transform.localScale = new Vector3(1, 1, 1); }
// class constructor public rpUIElement() { DBG.Log("Constructed"); }
void gotoOptions() { DBG.Log("Simulated Options Menu"); }
void continueGame() { DBG.Log("Simulated Game Continue"); }
void startGame() { DBG.Log("Simulated Game Start"); }