public static AssetBundleDeploymentInfo GetValue(SerializedProperty property) { AssetBundleDeploymentInfo value = new AssetBundleDeploymentInfo(); value.AssetBundleName = property.FindPropertyRelative("AssetBundleName").stringValue; value.Platform = (Platform)property.FindPropertyRelative("Platform").intValue; value.DeploymentType = (AssetBundleDeploymentType)property.FindPropertyRelative("DeploymentType").intValue; return(value); }
public static void PlatformDropDown(Rect rect, List <AssetBundleDeploymentInfo> list, string assetBundleName, System.Action <AssetBundleDeploymentInfo> block) { Platform[] allPlatforms; allPlatforms = ( PlatformUtil .AllPlatforms .ToArray() ); Platform[] existingPlatforms; existingPlatforms = ( list .Where(value => value.AssetBundleName.Equals(assetBundleName)) .Select(value => value.Platform) .ToArray() ); GenericMenu menu; menu = new GenericMenu(); for (int index = 0; index < allPlatforms.Length; index++) { Platform platform; platform = allPlatforms[index]; GenericMenu.MenuFunction callback; callback = () => { AssetBundleDeploymentInfo value = new AssetBundleDeploymentInfo(); value.AssetBundleName = assetBundleName; value.Platform = platform; value.DeploymentType = AssetBundleDeploymentType.Local; block(value); }; GUIContent content; content = new GUIContent(GetPlaformName(platform)); if (System.Array.IndexOf(existingPlatforms, platform) != -1) { menu.AddDisabledItem(content); } else { menu.AddItem(content, false, callback); } } menu.DropDown(rect); }
public static List <AssetBundleDeploymentInfo> NormalizeList(List <AssetBundleDeploymentInfo> list) { List <AssetBundleDeploymentInfo> normalized = list.GetRange(0, list.Count); foreach (string assetBundleName in AssetDatabase.GetAllAssetBundleNames()) { if (normalized.Where(value => value.AssetBundleName.Equals(assetBundleName) && value.Platform.Equals(Platform.Unknown)).Count() == 0) { AssetBundleDeploymentInfo value = new AssetBundleDeploymentInfo(); value.AssetBundleName = assetBundleName; value.Platform = Platform.Unknown; value.DeploymentType = AssetBundleDeploymentType.Local; normalized.Add(value); } } return(normalized); }
public static void SetValue(SerializedProperty property, AssetBundleDeploymentInfo deploymentInfo) { property.FindPropertyRelative("AssetBundleName").stringValue = deploymentInfo.AssetBundleName; property.FindPropertyRelative("Platform").intValue = (int)deploymentInfo.Platform; property.FindPropertyRelative("DeploymentType").intValue = (int)deploymentInfo.DeploymentType; }