Ejemplo n.º 1
0
        public static void CreateEmptySibling(MenuCommand cmd)
        {
            var newOne = new GameObject("");

            newOne.SetParent(cmd.GetGameObject().GetParent());
            newOne.SetSiblingIndex(cmd.GetGameObject().GetSiblingIndex() + 1);
        }
Ejemplo n.º 2
0
 public static void RenameChildrenAsFirstBehaviour(MenuCommand cmd)
 {
     Debug.Log($"Rename Children As Type Recursively for {cmd.GetGameObject().GetFindingPath()}");
     foreach (Transform childTrf in cmd.GetGameObject().transform)
     {
         childTrf.gameObject.RenameAsTypeRecursively <Behaviour>();
     }
 }
Ejemplo n.º 3
0
 public static void SavePrefab(MenuCommand cmd)
 {
     if (cmd.GetGameObject().IsPrefabRoot())
     {
         PrefabUtility.ApplyPrefabInstance(cmd.GetGameObject(), InteractionMode.UserAction);
     }
     else
     {
         Debug.LogWarning($"'{cmd.GetGameObject().GetFindingPath()}' is not a prefab root");
     }
 }
Ejemplo n.º 4
0
 public static void ParentUnderEmpty(MenuCommand cmd)
 {
     cmd.GetGameObject().AttachToNewEmptyParent();
 }
Ejemplo n.º 5
0
 public static void RenameDescendantsAsFirstBehaviours(MenuCommand cmd)
 {
     Debug.Log($"Rename As Type Recursively for {cmd.GetGameObject().GetFindingPath()}");
     cmd.GetGameObject().RenameAsTypeRecursively <Behaviour>();
 }
Ejemplo n.º 6
0
 public static void RenameAsFirstBehaviour(MenuCommand cmd)
 {
     cmd.GetGameObject().RenameAsType <Behaviour>();
 }
Ejemplo n.º 7
0
 public static void DeleteChildren(MenuCommand cmd)
 {
     cmd.GetGameObject().RemoveChildren();
 }
Ejemplo n.º 8
0
 public static void DeactivateDescendants(MenuCommand cmd)
 {
     cmd.GetGameObject().SetDescendantActivities(false);
 }