private void SetValue(Scene scene, object value, Action <object> set_callback) { if (value != null && value is UnityReference) { UnityReference reference = value as UnityReference; reference.UnitySetCallback = set_callback; scene.AddUnityReference(reference); } else { set_callback(value); } }
public static UnityReference FromUnity(Scene scene, UnityEngine.Object v) { UnityReference reference = null; if (v != null) { reference = new UnityReference(); reference.type = v.GetType(); reference.id = (uint)v.GetInstanceID(); reference.unityValue = v; scene.AddUnityReference(reference); } return(reference); }