private static void JSEditorDirectionalLightSelect(string _activity, string _params) { string uuid = ""; try { JSONNode root = JSON.Parse(_params); uuid = root["uuid"].Value; } catch (System.Exception e) { onNotify("Parse json has error: " + e.Message); } Light light = LightMgr.FindDirectionalLight(uuid); if (null == light) { onNotify(string.Format("{0} is not exists", uuid)); return; } Battlehub.RTEditor.RuntimeSelection.activeObject = light.gameObject; Battlehub.RTEditor.RuntimeEditor.Instance.SceneView.Focus(); }
private static void JSEditorExposeDirectionalLight(string _activity, string _params) { if (isLoading) { return; } try { JSONNode root = JSON.Parse(_params); string uuid = root["uuid"].Value; LightMgr.NewDirectionalLight(uuid); startLoading(); Light light = LightMgr.FindDirectionalLight(uuid); if (light == null) { onNotify(string.Format("{0} not instance", uuid)); return; } Battlehub.RTEditor.ExposeToEditor script = light.gameObject.GetComponent <Battlehub.RTEditor.ExposeToEditor>(); if (null == script) { script = light.gameObject.AddComponent <Battlehub.RTEditor.ExposeToEditor>(); //Debug.Log(script); } //SlateMgr.AttachGameObject(uuid); finishLoading(); } catch (System.Exception e) { onNotify("Parse json has error: " + e.Message); } }