コード例 #1
0
ファイル: EditorStyle.cs プロジェクト: qyadmin/SwimTime
        void OnGUI()
        {
            GUILayout.Space(30);
            AssetName = EditorGUILayout.TextField("AssetsName:", AssetName);
            GUILayout.Space(20);
            SytleName = EditorGUILayout.TextField("StyleName:", SytleName);
            GUILayout.Space(50);
            if (GUILayout.Button("OK", GUILayout.Width(250), GUILayout.Height(30)))
            {
                if (!CheckName(SytleName))
                {
                    if (EditorUtility.DisplayDialog("Message", "The name has been used, please redefine the style name", "OK"))
                    {
                        return;
                    }
                }
                var cfg = ScriptableObject.CreateInstance <StyleSetting>();
                MyText = (StyleSetting)cfg;
                SetFontDemoSytle();
                cfg.TextMark = SytleName;
                if (!AssetDatabase.IsValidFolder(Path))
                {
                    AssetDatabase.CreateFolder("Assets/DH_TextStyle/Resources", "Data");
                }
                AssetDatabase.CreateAsset(cfg, Path + "/" + AssetName + ".asset");

                AssetDatabase.SaveAssets();
                if (EditorUtility.DisplayDialog("Message", "save successfully", "OK"))
                {
                    DemoGradient.ChangState(SytleName);
                    this.Close();
                }
            }
        }
コード例 #2
0
ファイル: EditorStyle.cs プロジェクト: qyadmin/SwimTime
    public StyleSetting GetContainer(string NUB)
    {
        StyleSetting obj = null;

        SaveText.TryGetValue(NUB, out obj);
        return(obj);
    }
コード例 #3
0
        /// <summary>
        /// Updates an existing style.
        /// Documentation https://developers.google.com/fusiontables/v1/reference/style/update
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated fusiontables service.</param>
        /// <param name="tableId">Table whose style is being updated.</param>
        /// <param name="styleId">Identifier (within a table) for the style being updated.</param>
        /// <param name="body">A valid fusiontables v1 body.</param>
        /// <returns>StyleSettingResponse</returns>
        public static StyleSetting Update(fusiontablesService service, string tableId, int styleId, StyleSetting body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (tableId == null)
                {
                    throw new ArgumentNullException(tableId);
                }

                // Make the request.
                return(service.Style.Update(body, tableId, styleId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Style.Update failed.", ex);
            }
        }
コード例 #4
0
ファイル: EditorStyle.cs プロジェクト: qyadmin/SwimTime
 void UpdateSytleMessage(string GetNub)
 {
     MyText = GetContainer(GetNub);
 }
コード例 #5
0
        private static bool PathExists(MusicSource rootFolder, StyleSetting setting, string name)
        {
            var path = Path.Combine(rootFolder.DiskRoot, setting.Path);

            return(Directory.Exists(path) && Directory.EnumerateDirectories(path).SingleOrDefault(d => Path.GetFileName(d).IsEqualIgnoreAccentsAndCase(name)) != null);
        }