public bool Create(AuthorCreation creation, out AuthorPeice peice)
 {
     if (this.creator == null)
     {
         peice = null;
         return false;
     }
     peice = this.creator(creation, this);
     return peice;
 }
Exemple #2
0
 public bool Contains(AuthorPeice comp)
 {
     if (this.allPeices != null)
     {
         foreach (AuthorPeice peice in this.allPeices)
         {
             if ((peice != null) && (peice == comp))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Exemple #3
0
    public virtual AuthorShared.PeiceAction PeiceListGUI()
    {
        bool flag = (AuthorShared.SelectionContains(this.selectReference) ? true : AuthorShared.SelectionContains(this));

        AuthorShared.PeiceAction peiceAction = AuthorShared.PeiceAction.None;
        AuthorShared.BeginHorizontal(new GUILayoutOption[0]);
        AuthorPeice.ActionButton(this.peiceID, ref peiceAction, flag, AuthorShared.PeiceAction.AddToSelection, AuthorShared.PeiceAction.RemoveFromSelection, AuthorShared.Styles.peiceButtonLeft, new GUILayoutOption[0]);
        AuthorPeice.ActionButton(AuthorShared.Icon.solo, ref peiceAction, flag, AuthorShared.PeiceAction.SelectSolo, AuthorShared.Styles.peiceButtonMid, new GUILayoutOption[] { GUILayout.ExpandWidth(false) });
        Color color = GUI.contentColor;

        GUI.contentColor = Color.red;
        AuthorPeice.ActionButton(AuthorShared.Icon.delete, ref peiceAction, flag, AuthorShared.PeiceAction.Delete, AuthorShared.Styles.peiceButtonRight, new GUILayoutOption[] { GUILayout.ExpandWidth(false) });
        GUI.contentColor = color;
        AuthorShared.EndHorizontal();
        return(peiceAction);
    }
Exemple #4
0
 internal void UnregisterPeice(AuthorPeice peice)
 {
     if (this.allPeices != null && this.allPeices.IndexOf(peice) != -1)
     {
         this.OnWillUnregisterPeice(peice);
         this.allPeices.Remove(peice);
         if (this.selected != null)
         {
             this.selected.Remove(peice);
         }
         this.OnUnregisteredPeice(peice);
         if (!Application.isPlaying)
         {
             AuthorShared.SetDirty(this);
         }
     }
 }
Exemple #5
0
 protected virtual bool RegisterPeice(AuthorPeice peice)
 {
     if (this.allPeices != null)
     {
         if (this.allPeices.Contains(peice))
         {
             return(false);
         }
         this.allPeices.Add(peice);
     }
     else
     {
         this.allPeices = new List <AuthorPeice>()
         {
             peice
         };
     }
     peice.Registered(this);
     return(true);
 }
Exemple #6
0
 public virtual string RootBonePath(AuthorPeice callingPeice, Transform bone)
 {
     return(AuthorShared.CalculatePath(bone, bone.root));
 }
Exemple #7
0
 private bool RegisterPeice(AuthorPeice peice, string id)
 {
     peice.peiceID = id;
     return(this.RegisterPeice(peice));
 }
Exemple #8
0
 protected virtual void OnWillUnregisterPeice(AuthorPeice peice)
 {
 }
Exemple #9
0
 protected virtual void OnUnregisteredPeice(AuthorPeice peice)
 {
 }