protected void RefreshPropertyLists() { // reset lists of properties m_CloudDataProperties = new List <SerializedProperty>(); m_NewCloudDataProperties = new List <SerializedProperty>(); // iterate through all properties on this behavior CloudDataMonoBehaviour behavior = target as CloudDataMonoBehaviour; var cloudDataFields = behavior.GetAllCloudDataFields(); foreach (var pair in cloudDataFields) { var info = pair.Key; var cloudDataAttr = pair.Value; BaseCloudDataSheet sheet = behavior.defaultCloudDataSheet; // Try to load the custom cloud data sheet specified by the attribute if (cloudDataAttr.sheetPath != null) { sheet = CloudDataManager.GetSheet(cloudDataAttr.sheetPath); if (sheet == null) { Debug.LogWarning(string.Format("[Unity Cloud Data] No CloudDataSheet with alias '{0}' found for {1}.{2}", cloudDataAttr.sheetPath, behavior.GetType().FullName, info.Name)); } } // If a sheet exists, determine if this key has been added or not if (sheet != null) { // check if the sheet actually HAS the field string cloudDataKey = target.GetType().FullName + "." + info.Name; if (sheet.ContainsKey(cloudDataKey)) { m_CloudDataProperties.Add(serializedObject.FindProperty(info.Name)); continue; } } m_NewCloudDataProperties.Add(serializedObject.FindProperty(info.Name)); } // generate the list of properties that AREN'T for cloud data m_ExcludedProperties = (from prop in m_CloudDataProperties select prop.name) .Concat (from prop in m_NewCloudDataProperties select prop.name).ToArray(); }
protected virtual void OnCloudDataSheetRefreshCacheComplete(BaseCloudDataSheet sheet) { RefreshPropertyLists(); EditorUtility.SetDirty(target); }
void OnCreateFinish(BaseCloudDataSheet sheet, bool success) { Debug.Log("[Unity Cloud Data] Sync status: " + success); }