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(); }
void OnLightChanged(object sender, LightMgr.LightEventArgs e) { if ((e.Group == Group) && (e.Light == Light)) { if (RendererWithMat != null) { RendererWithMat.material.color = Color.Lerp(Color.grey, e.Data.LightColor, e.Data.LightIntensity); } } }
void OnLightMgrLightChanged(object sender, LightMgr.LightEventArgs e) { if (_animator == null) return; if (SyncFromLightEffect != null) return; if ((e.Group == Group) && (e.Light == Light)) { float val = e.Data.LightIntensity; UpdateWithScrubValue(val); } }
private static void JSUnloadDirectionalLight(string _activity, string _params) { if (isLoading) { return; } try { JSONNode root = JSON.Parse(_params); string uuid = root["uuid"].Value; LightMgr.UnloadDirectionalLight(uuid); } catch (System.Exception e) { onNotify("Parse json has error: " + e.Message); } }
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); } }
private void preloadLightManager() { this.LogTrace("preload Light manager..."); LightMgr.Preload(); }
void Awake() { Instance = this; }
private static void JSNewNewDirectionalLight(string _activity, string _params) { string uuid = LightMgr.NewDirectionalLight(); MessageToJS("JSOnNewNewDirectionalLight", _activity, string.Format("|{{\"uuid\":{0}}}", uuid)); }