Last active
August 29, 2015 14:10
-
-
Save JonRurka/11df75b2c93da1c07d87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Serializable] | |
public struct REPLInfo | |
{ | |
public int ID; | |
public string Name; | |
public List<string> Text; | |
public Vector2 ScrollPos; | |
public REPLInfo(int id, string name) | |
{ | |
ID = id; | |
Name = name; | |
Text = new List<string>(); | |
ScrollPos = new Vector2(); | |
} | |
public void AddText(string text) | |
{ | |
Text.Add("> " + text); | |
} | |
public void SetScrollPos(Vector2 newPos) | |
{ | |
ScrollPos = newPos; | |
DConsole.Log("Scoll bar pos set to " + newPos + ", " + ScrollPos); | |
} | |
public override string ToString() | |
{ | |
string result = string.Empty; | |
foreach (string str in Text) | |
{ | |
result += str + "\n"; | |
} | |
return result; | |
} | |
} | |
public List<REPLInfo> PlayerREPL = new List<REPLInfo>(); | |
void Start () { | |
PlayerREPL.Add(new REPLInfo(PlayerREPL.Count, GameManager.Instance.PlayerName)); | |
DConsole.Log(PlayerREPL[0].ScrollPos); | |
PlayerREPL[0].SetScrollPos(new Vector2(1, 1)); | |
DConsole.Log(PlayerREPL[0].ScrollPos); | |
} | |
--Log output-- | |
(0٫0, 0٫0) | |
Scoll bar pos set to (1٫0, 1٫0), (1٫0, 1٫0) | |
(0٫0, 0٫0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment