示例#1
0
 public void OnObjectPickerChanged(ObjectPickerContext context, WrappedVariable variable, UnityObjectDescription objectDescription)
 {
     if (context.ComponentGuid != Guid.Empty)
     {
         // Remote component GUID specified, send a SetVariableRequest to update a field or property
         variable.Value = (objectDescription != null) ? objectDescription.Guid : Guid.Empty;
         APIManager.SendToPlayers(new SetVariableRequest(context.ComponentGuid, variable));
     }
     else if (context.ArgumentIndex != -1)
     {
         // If an argument index is supplied, this is updating an editor driven method argument set
         arguments[context.ArgumentIndex].Value = (objectDescription != null) ? objectDescription.Guid : Guid.Empty;
     }
     else
     {
         throw new NotImplementedException();
     }
 }
        public void OnObjectPickerChanged(Guid componentInstanceGuid, WrappedVariable variable, UnityObjectDescription objectDescription)
        {
            Debug.Log("OnObjectPickerChanged");
            variable.Value = (objectDescription != null) ? objectDescription.Guid : Guid.Empty;
            commonContext.APIManager.SendToPlayers(new SetVariableRequest(componentInstanceGuid, variable));

            //SendToPlayers(APIRequest.GetUnityObjects, componentDescription, variable.TypeFullName, variable.AssemblyName);
        }