void Start() { //为 MoblileDebugger 添加按钮 MoblileDebugger.AddTestFunction("打印Log", Log); MoblileDebugger.AddTestFunction("打印Warning", Warning); MoblileDebugger.AddTestFunction("打印Error", Error); }
void Awake() { if (instance != null && instance != this) { Destroy(transform.parent.gameObject); } instance = this; if (enableLog) { enabelLogBtn = transform.Find("EnableLogBtn").GetComponent <Button> (); enabelLogBtn.onClick.AddListener(EnableLogBtnOnClick); logObject = transform.Find("LogerObject").gameObject; log = logObject.GetComponent <MoblileLog> (); log.Initialization(logerCapacity, showStackTrace); } if (enableTest) { enableTestBtn = transform.Find("EnableTestBtn").GetComponent <Button> (); enableTestBtn.onClick.AddListener(EnableTestBtnOnClick); testerObject = transform.Find("TesterObject").gameObject; tester = testerObject.GetComponent <MoblileTester> (); } DontDestroyOnLoad(transform.parent.gameObject); }