Пример #1
0
        private void OnPrefabLinkShowPressed()
        {
            GameObject[] values = this.GetValue().Cast <GameObject>().Where(o => o.PrefabLink != null).ToArray();
            Duality.Resources.PrefabLink link = values.First().PrefabLink;

            DualityEditorApp.Highlight(this, new ObjectSelection(link.Prefab.Res));
        }
Пример #2
0
        private void OnPrefabLinkShowPressed()
        {
            GameObject[] values = this.GetValue().Cast <GameObject>().Where(o => o.PrefabLink != null).ToArray();
            Duality.Resources.PrefabLink link = values.First().PrefabLink;

            ProjectFolderView view = EditorBasePlugin.Instance.RequestProjectView();

            view.FlashNode(view.NodeFromPath(link.Prefab.Path));
            System.Media.SystemSounds.Beep.Play();
        }
Пример #3
0
        protected bool IsMemberInPrefabLinkChanges(MemberInfo info)
        {
            if (info == null)
            {
                return(false);
            }

            Component[] values = this.GetValue().Cast <Component>().NotNull().ToArray();
            return(values.Any(delegate(Component c)
            {
                Duality.Resources.PrefabLink l = c.GameObj.AffectedByPrefabLink;
                return l != null && l.HasChange(c, info as PropertyInfo);
            }));
        }
Пример #4
0
 protected override bool IsChildValueModified(PropertyEditor childEditor)
 {
     if (this.jointEditors.Contains(childEditor))
     {
         Component[] values = this.GetValue().Cast <Component>().NotNull().ToArray();
         return(values.Any(c =>
         {
             Duality.Resources.PrefabLink l = c.GameObj.AffectedByPrefabLink;
             return l != null && l.HasChange(c, ReflectionInfo.Property_RigidBody_Joints);
         }));
     }
     else
     {
         return(base.IsChildValueModified(childEditor));
     }
 }
Пример #5
0
        protected override bool IsChildValueModified(PropertyEditor childEditor)
        {
            MemberInfo info = childEditor.EditedMember;

            if (childEditor == this.editorPos)
            {
                info = ReflectionInfo.Property_Transform_RelativePos;
            }
            else if (childEditor == this.editorVel)
            {
                info = ReflectionInfo.Property_Transform_RelativeVel;
            }
            else if (childEditor == this.editorScale)
            {
                info = ReflectionInfo.Property_Transform_RelativeScale;
            }
            else if (childEditor == this.editorAngle)
            {
                info = ReflectionInfo.Property_Transform_RelativeAngle;
            }
            else if (childEditor == this.editorAngleVel)
            {
                info = ReflectionInfo.Property_Transform_RelativeAngleVel;
            }

            if (info != null)
            {
                Component[] values = this.GetValue().Cast <Component>().NotNull().ToArray();
                return(values.Any(delegate(Component c)
                {
                    Duality.Resources.PrefabLink l = c.GameObj.AffectedByPrefabLink;
                    return l != null && l.HasChange(c, info as PropertyInfo);
                }));
            }
            else
            {
                return(base.IsChildValueModified(childEditor));
            }
        }