public void SetInterval(string inStr) { float f = 0f; foreach (string s in inStr.Split(' ')) { float t; if (float.TryParse(s, out t)) { f += t; } } m_Interval = f; m_ColThread.SetInterval(m_Interval); Debug.Log("LMS_GuiBaseLabel:: Updated Interval!"); }
void Awake() { m_ColorThread = gameObject.AddComponent <LMS_ColorThread>(); m_ColorThread.SetInterval(0.5f); m_ColorThread.IgnoreOwner = true; m_ColorThread.Render = true; InitLabels(); InitButtons(); Owner = LMS_GuiBaseUtils.InstantiateGUIElement <LMS_GuiBaseBox2D>(new LMS_GuiConfig() { Rect = new Rect(Screen.width / 2 - 400f, Screen.height / 2 - 250f, 800f, 500f) }, 20000, null); Owner.RegisterClientViewTick((view) => { Owner.SetTexture((int)E_Texture.IDLE, new Texture2D(1, 1).Modify((tex) => { tex.SetPixel(0, 0, m_ColorThread.RawValue().AlterAlpha(0.7f)); tex.Apply(); })); }, null); Owner.primary = true; Owner.Draggable = true; Owner.AddChild(m_Title); Owner.AddChild(GEditor); Owner.AddChild(GEditorLabel); Owner.AddChild(Colors); Owner.AddChild(ColorsLabel); }