コード例 #1
0
        void UpdateComment()
        {
            if (m_Comment == null)
            {
                m_Comment = serializedObject.FindProperty("m_Comment");
            }

            if (m_CommentEditor == null)
            {
                m_CommentEditor = new CommentEditor(serializedObject, m_Comment, true);
            }

            commentAsset = (serializedObject.targetObject as CommentAsset);

            if (commentAsset.firstTimeEdit)
            {
                RequestEdit();
            }
        }
コード例 #2
0
        void Refresh()
        {
            if (results == null)
            {
                results = new List <Tuple <Comment, UnityEngine.Object> >();
            }
            else
            {
                results.Clear();
            }

            foreach (var obj in Resources.FindObjectsOfTypeAll(typeof(SceneComment)))
            {
                results.Add(new Tuple <Comment, UnityEngine.Object>((obj as SceneComment).comment, obj));
            }
            foreach (var guid in AssetDatabase.FindAssets($"t:{typeof(CommentAsset).Name}"))
            {
                CommentAsset ca = AssetDatabase.LoadAssetAtPath <CommentAsset>(AssetDatabase.GUIDToAssetPath(guid));
                results.Add(new Tuple <Comment, UnityEngine.Object>(ca.comment, ca));
            }
            SortResults();
            Repaint();
        }