示例#1
0
        void VRMMetaObjectGUI(SerializedObject so)
        {
            InitMap(so);
            if (m_propMap == null || m_propMap.Count == 0)
            {
                return;
            }

            so.Update();

            GUI.enabled = false;
            EditorGUILayout.PropertyField(m_propMap["ExporterVersion"]);
            if (VRMVersion.IsNewer(m_propMap["ExporterVersion"].stringValue))
            {
                EditorGUILayout.HelpBox("Check UniVRM new version. https://github.com/dwango/UniVRM/releases", MessageType.Warning);
            }
            GUI.enabled = true;

            m_foldoutInfo = EditorGUILayout.Foldout(m_foldoutInfo, "Information");
            if (m_foldoutInfo)
            {
                EditorGUILayout.PropertyField(m_propMap["Title"]);
                EditorGUILayout.PropertyField(m_propMap["Version"]);
                EditorGUILayout.PropertyField(m_propMap["Author"]);
                EditorGUILayout.PropertyField(m_propMap["ContactInformation"]);
                EditorGUILayout.PropertyField(m_propMap["Reference"]);

                var thumbnail = m_propMap["Thumbnail"];
                EditorGUILayout.PropertyField(thumbnail);
                thumbnail.objectReferenceValue = TextureField("", (Texture2D)thumbnail.objectReferenceValue, 100);
            }

            EditorGUILayout.LabelField("License ", EditorStyles.boldLabel);

            m_foldoutPermission = EditorGUILayout.Foldout(m_foldoutPermission, "Personation / Characterization Permission");
            if (m_foldoutPermission)
            {
                EditorGUILayout.PropertyField(m_propMap["AllowedUser"], new GUIContent("A person who can perform with this avatar"), false);
                EditorGUILayout.PropertyField(m_propMap["ViolentUssage"], new GUIContent("Violent acts using this avatar"));
                EditorGUILayout.PropertyField(m_propMap["SexualUssage"], new GUIContent("Sexuality acts using this avatar"));
                EditorGUILayout.PropertyField(m_propMap["CommercialUssage"], new GUIContent("For commercial use"));
                EditorGUILayout.PropertyField(m_propMap["OtherPermissionUrl"], new GUIContent("Other License Url"));
            }

            m_foldoutDistribution = EditorGUILayout.Foldout(m_foldoutDistribution, "Redistribution / Modifications License");
            if (m_foldoutDistribution)
            {
                var licenseType = m_propMap["LicenseType"];
                EditorGUILayout.PropertyField(licenseType);
                if ((LicenseType)licenseType.intValue == LicenseType.Other)
                {
                    EditorGUILayout.PropertyField(m_propMap["OtherLicenseUrl"]);
                }
            }

            so.ApplyModifiedProperties();
        }
示例#2
0
        public void ParseVersionTest(string version, bool canBeParsed, int major, int minor, int patch, string pre)
        {
            VRMVersion.Version v;
            var res = VRMVersion.ParseVersion(version, out v);

            Assert.AreEqual(canBeParsed, res);
            if (res)
            {
                Assert.AreEqual(major, v.Major);
                Assert.AreEqual(minor, v.Minor);
                Assert.AreEqual(patch, v.Patch);
                Assert.AreEqual(pre, v.Pre);
            }
        }
示例#3
0
 public void IsNewerTest(string newer, string older, bool isNewer)
 {
     Assert.AreEqual(isNewer, VRMVersion.IsNewer(newer, older));
 }