Beispiel #1
0
        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);
      }
       }
 }
Beispiel #3
0
    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);
          }
    }
Beispiel #4
0
        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);
            }
        }
Beispiel #5
0
        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);
            }
        }
Beispiel #6
0
 private void preloadLightManager()
 {
     this.LogTrace("preload Light manager...");
     LightMgr.Preload();
 }
Beispiel #7
0
 void Awake()
 {
     Instance = this;
 }
Beispiel #8
0
        private static void JSNewNewDirectionalLight(string _activity, string _params)
        {
            string uuid = LightMgr.NewDirectionalLight();

            MessageToJS("JSOnNewNewDirectionalLight", _activity, string.Format("|{{\"uuid\":{0}}}", uuid));
        }