private void OnDestroy() { if (instance == this) { instance = null; } }
private void Awake() { if (instance == null) { instance = this; m_labelOfsts = new Dictionary <string, long>(); m_variableInts = new Dictionary <string, int>(); m_variableFloats = new Dictionary <string, float>(); m_variableStrings = new Dictionary <string, string>(); isError = false; isPlay = false; // CommandFunctionのテーブルを作成する m_commandFunctons = new Dictionary <string, CommandFunction>() { { "wait", CommandWait }, { "goto", CommandGoto }, { "print", CommandPrint }, { "set", CommandSet }, { "add", CommandAdd }, { "sub", CommandSub }, { "mul", CommandMul }, { "div", CommandDiv }, { "ifeq", CommandIFEQ }, { "ifno", CommandIFNOTEQ }, { "ifls", CommandIFLS }, { "ifle", CommandIFLE }, { "ifgr", CommandIFGR }, { "ifge", CommandIFGE }, { "touch", CommandTouch }, { "button", CommandButton }, { "axisraw", CommandAxisRaw }, { "mousebutton", CommandMouseButton }, { "mousepos", CommandMousePosition }, }; } else { Destroy(this); } }