예제 #1
0
        public static void ShowWindow(TaskContentAsset contentAsset)
        {
            TaskEditorWindow window = GetWindow <TaskEditorWindow>();

            window.titleContent.image = EditorGUIUtility.IconContent("AnimatorStateMachine Icon").image;
            window.titleContent.text  = "Task Editor";
            window._asset             = contentAsset;
            window.minSize            = new Vector2(800, 600);
            window.maxSize            = new Vector2(Screen.currentResolution.width, Screen.currentResolution.height);
            window.Show();
        }
        private static bool OnOpenAsset(int instanceID, int line)
        {
            TaskContentAsset asset = EditorUtility.InstanceIDToObject(instanceID) as TaskContentAsset;

            if (asset)
            {
                TaskEditorWindow.ShowWindow(asset);
                return(true);
            }
            return(false);
        }
예제 #3
0
        public static void ShowWindow(TaskEditorWindow taskEditorWindow, TaskContentAsset contentAsset)
        {
            TaskRegenIDWindow window = GetWindow <TaskRegenIDWindow>();

            window.titleContent.image = EditorGUIUtility.IconContent("d_editicon.sml").image;
            window.titleContent.text  = "Regen Task ID";
            window._taskEditorWindow  = taskEditorWindow;
            window._contentAsset      = contentAsset;
            window.minSize            = new Vector2(220, 160);
            window.maxSize            = new Vector2(220, 160);
            window.position           = new Rect(taskEditorWindow.position.x + 50, taskEditorWindow.position.y + 50, 200, 110);
            window.Show();
        }
예제 #4
0
        /// <summary>
        /// 打开窗口
        /// </summary>
        /// <param name="contentAsset">任务资源</param>
        public static void ShowWindow(TaskContentAsset contentAsset)
        {
            TaskEditorWindow window = GetWindow <TaskEditorWindow>();

            window.titleContent.image = EditorGUIUtility.IconContent("AnimatorStateMachine Icon").image;
            window.titleContent.text  = "Task Editor";
            window._contentAsset      = contentAsset;
            window._currentContent    = null;
            window._taskContentList   = null;
            if (!EditorApplication.isPlaying)
            {
                window.ReSet();
            }
            window.minSize = new Vector2(800, 600);
            window.maxSize = new Vector2(Screen.currentResolution.width, Screen.currentResolution.height);
            window.Show();
        }
        private static bool OnOpenAsset(int instanceID, int line)
        {
            TaskContentAsset asset = EditorUtility.InstanceIDToObject(instanceID) as TaskContentAsset;

            if (asset)
            {
                if (asset.IsExistMissed())
                {
                    Log.Error("任务资源存在丢失脚本的对象,请先点击 Clear Missed Task 清空丢失脚本的对象!");
                    return(false);
                }
                else
                {
                    TaskEditorWindow.ShowWindow(asset);
                    return(true);
                }
            }
            return(false);
        }