Пример #1
0
        protected override void OnItemContextMenu(GenericMenu menu, MemberInspectorTreeElement treeElement)
        {
            StratusComponentInformation.MemberReference member = treeElement.data;

            // 1. Select
            menu.AddItem(new GUIContent("Select"), false, () => Selection.activeGameObject = member.componentInfo.gameObject);

            if (!Application.isPlaying)
            {
                // 2. Watch
                bool isFavorite = member.isWatched;
                if (isFavorite)
                {
                    menu.AddItem(new GUIContent("Remove Watch"), false, () => member.componentInfo.RemoveWatch(member));
                }
                else
                {
                    menu.AddItem(new GUIContent("Watch"), false, () =>
                    {
                        GameObject target = member.componentInfo.gameObject;
                        //bool hasBookmark = target.HasComponent<GameObjectBookmark>();
                        //if (!hasBookmark)
                        //{
                        //  MemberInspectorWindow.SetBookmark(member.componentInfo.gameObject);
                        //}
                        member.componentInfo.Watch(member);
                    });
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Removes a member from the watch list
 /// </summary>
 /// <param name="memberReference"></param>
 public void RemoveWatch(StratusComponentInformation.MemberReference memberReference)
 {
     memberReference.isWatched = false;
     if (this.AssertMemberIndex(memberReference))
     {
         this.watchList.RemoveAll(x => x.name == memberReference.name && x.memberIndex == memberReference.memberIndex);
         StratusGameObjectBookmark.UpdateWatchList(true);
     }
 }
Пример #3
0
 /// <summary>
 /// Adds a member to the watch list
 /// </summary>
 /// <param name="member"></param>
 /// <param name="componentInfo"></param>
 /// <param name="memberIndex"></param>
 public void Watch(StratusComponentInformation.MemberReference memberReference)
 {
     memberReference.isWatched = true;
     if (this.AssertMemberIndex(memberReference))
     {
         this.watchList.Add(memberReference);
         StratusGameObjectBookmark.UpdateWatchList(true);
     }
 }