private static void SelectWatermark(int index)
 {
     string[] names = Watermarks.GetNames();
     Watermarks.Set(SkillEditor.SelectedFsm, names[index]);
     SkillEditor.SetFsmDirty(false, false);
     WatermarkSelector.selectedWatermarkIndex = index;
 }
        public static void OnGUI()
        {
            if (!FsmEditorSettings.EnableWatermarks)
            {
                GUILayout.Label(Strings.get_Label_Watermarks_Are_Disabled(), new GUILayoutOption[0]);
                if (GUILayout.Button(Strings.get_Command_Enable_Watermarks(), new GUILayoutOption[0]))
                {
                    FsmEditorSettings.EnableWatermarks = true;
                }
                if (GUILayout.Button(Strings.get_Command_Finished(), new GUILayoutOption[0]))
                {
                    WatermarkSelector.Cancel();
                }
                GUILayout.FlexibleSpace();
                return;
            }
            GUILayout.Label(Strings.get_Label_Select_A_Watermark(), new GUILayoutOption[0]);
            SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
            WatermarkSelector.scrollViewPosition = GUILayout.BeginScrollView(WatermarkSelector.scrollViewPosition, new GUILayoutOption[0]);
            Color color = GUI.get_color();

            GUI.set_contentColor(SkillEditorStyles.WatermarkTintSolid);
            int num = GUILayout.SelectionGrid(WatermarkSelector.selectedWatermarkIndex, WatermarkSelector.watermarkThumbs, 4, new GUILayoutOption[]
            {
                GUILayout.Width(WatermarkSelector.gridWidth),
                GUILayout.Height(WatermarkSelector.gridHeight)
            });

            if (num != WatermarkSelector.selectedWatermarkIndex)
            {
                WatermarkSelector.SelectWatermark(num);
            }
            GUI.set_contentColor(color);
            GUILayout.EndScrollView();
            SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
            if (GUILayout.Button(Strings.get_Command_Clear_Watermark(), new GUILayoutOption[0]))
            {
                Watermarks.Set(SkillEditor.SelectedFsm, "");
                WatermarkSelector.Cancel();
            }
            if (GUILayout.Button(Strings.get_Command_Finished(), new GUILayoutOption[0]))
            {
                WatermarkSelector.Cancel();
            }
            if (FsmEditorSettings.ShowHints)
            {
                GUILayout.Box(Strings.get_Hint_Watermarks(), SkillEditorStyles.HintBox, new GUILayoutOption[0]);
            }
            EditorGUILayout.Space();
        }
예제 #3
0
 public static Texture SetWatermarkTexture(Skill fsm, string textureName)
 {
     return(Watermarks.Set(fsm, textureName));
 }