private static T GetAttribute <T> (AttributeLookup attributeLookup) { var attributes = attributeLookup(typeof(T), true); if (attributes.Length == 1) { return((T)attributes [0]); } return(default(T)); }
private static bool HasRequiredLicense(AttributeLookup attributeLookup, out string message) { var requiredComponents = new List <String> (); var licenseAttribute = GetAttribute <UTRequiresLicenseAttribute> (attributeLookup); if (licenseAttribute != null) { var theLicense = licenseAttribute.license; if ((theLicense & UTLicense.UnityPro) != 0 && !UTils.IsUnityPro) { requiredComponents.Add("Unity Pro"); } if ((theLicense & UTLicense.IosPro) != 0 && !UTils.HasAdvancedLicenseOn(UnityEditor.BuildTarget.iOS)) { requiredComponents.Add("iOS Pro"); } if ((theLicense & UTLicense.AndroidPro) != 0 && !UTils.HasAdvancedLicenseOn(UnityEditor.BuildTarget.Android)) { requiredComponents.Add("Android Pro"); } } else { // legacy attributes support, this will be removed later. #pragma warning disable 618 var unityProAttribute = GetAttribute <UTRequiresUnityPro> (attributeLookup); if (unityProAttribute != null && !UTils.IsUnityPro) { requiredComponents.Add("Unity Pro"); } var unityIosAttribute = GetAttribute <UTRequiresiOS> (attributeLookup); if (unityIosAttribute != null && unityIosAttribute.iOSPro && !UTils.HasAdvancedLicenseOn(UnityEditor.BuildTarget.iOS)) { requiredComponents.Add("iOS Pro"); } var unityAndroidAttribute = GetAttribute <UTRequiresAndroid> (attributeLookup); if (unityAndroidAttribute != null && unityAndroidAttribute.androidPro && !UTils.HasAdvancedLicenseOn(UnityEditor.BuildTarget.Android)) { requiredComponents.Add("Android Pro"); } #pragma warning restore 618 } if (requiredComponents.Count > 0) { message = String.Join(", ", requiredComponents.ToArray()); return(false); } message = ""; return(true); }
public Log(AttributeLookup lookUp) { this.lookUp = lookUp; }
internal bool IsSet(IdentValue attribute) { return(AttributeLookup.SafeLookup(attribute) == BoolValue.True); }
public Log(AttributeLookup lookUp) { this.lookUp = lookUp; }