예제 #1
0
파일: rpMenu.cs 프로젝트: DigitalDruid/RP
        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);
        }
예제 #2
0
파일: rpMenu.cs 프로젝트: DigitalDruid/RP
        //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);
        }
예제 #3
0
파일: rpActor.cs 프로젝트: DigitalDruid/RP
 // Init
 public virtual void init()
 {
     DBG.Add(displayName() + " Created", true);
     makeNewLists();
     DBG.Add(displayLevel(), true);
     if (!DBG.Paused)
     {
         DBG.Log();
     }
     setupStats(_level);
 }
예제 #4
0
파일: rpMenu.cs 프로젝트: DigitalDruid/RP
        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);
        }
예제 #5
0
파일: rpPlayer.cs 프로젝트: DigitalDruid/RP
 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);
     }
 }
예제 #6
0
 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();
 }
예제 #7
0
파일: rpPanel.cs 프로젝트: DigitalDruid/RP
 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);
 }
예제 #8
0
파일: rpActor.cs 프로젝트: DigitalDruid/RP
        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();
            }
        }
예제 #9
0
 public virtual void Start()
 {
     DBG.Log(this, "Start");
     Init();
 }
예제 #10
0
 // Use this for initialization
 public virtual void Awake()
 {
     DBG.Log(this, "Awake");
 }
예제 #11
0
 void Init()
 {
     DBG.Log(this, "Initializing");
     //transform.localScale = new Vector3(1, 1, 1);
 }
예제 #12
0
 // class constructor
 public rpUIElement()
 {
     DBG.Log("Constructed");
 }
예제 #13
0
 void gotoOptions()
 {
     DBG.Log("Simulated Options Menu");
 }
예제 #14
0
 void continueGame()
 {
     DBG.Log("Simulated Game Continue");
 }
예제 #15
0
 void startGame()
 {
     DBG.Log("Simulated Game Start");
 }