public override void Submit()
        {
            ParametersController controller = gObject.GetComponent <ParametersController>();

            if (null != controller && !controller.IsDeletable())
            {
                return;
            }

            ToolsUIManager.Instance.SpawnDeleteInstanceVFX(gObject);

            CommandGroup      constraintGroup = null;
            List <Constraint> constraints     = ConstraintManager.GetObjectConstraints(gObject);

            if (constraints.Count > 0)
            {
                constraintGroup = new CommandGroup("Constraints");
                foreach (Constraint constraint in constraints)
                {
                    new CommandRemoveConstraint(constraint.constraintType, constraint.gobject).Submit();
                }
            }

            Redo();
            CommandManager.AddCommand(this);

            if (null != constraintGroup)
            {
                constraintGroup.Submit();
            }
        }
Beispiel #2
0
        public static void RemoveObjectConstraint(GameObject gobject, ConstraintType constraintType)
        {
            switch (constraintType)
            {
            case ConstraintType.Parent:
                ConstraintManager.RemoveConstraint <ParentConstraint>(gobject);
                break;

            case ConstraintType.LookAt:
                ConstraintManager.RemoveConstraint <LookAtConstraint>(gobject);
                break;
            }
            Instance.scene.RemoveObjectConstraint(gobject, constraintType);
        }
Beispiel #3
0
        public static void AddObjectConstraint(GameObject gobject, ConstraintType constraintType, GameObject target)
        {
            switch (constraintType)
            {
            case ConstraintType.Parent:
                ConstraintManager.AddParentConstraint(gobject, target);
                break;

            case ConstraintType.LookAt:
                ConstraintManager.AddLookAtConstraint(gobject, target);
                break;
            }
            Instance.scene.AddObjectConstraint(gobject, constraintType, target);
        }
Beispiel #4
0
        public static void ClearScene()
        {
            firstSave = true;
            CommandManager.SetSceneDirty(false);

            CameraManager.Instance.Clear();
            AnimationEngine.Instance.Clear();
            Selection.Clear();
            ConstraintManager.Clear();
            ShotManager.Instance.Clear();

            clearSceneEvent.Invoke();
            Instance.scene.ClearScene();
        }
Beispiel #5
0
 // Constraints
 public static void InsertObjectConstraint(int index, Constraint constraint)
 {
     ConstraintManager.InsertConstraint(index, constraint);
     Instance.scene.InsertObjectConstraint(index, constraint);
 }
Beispiel #6
0
 public CommandRemoveConstraint(ConstraintType constraintType, GameObject gobject)
 {
     ConstraintManager.FindConstraint(gobject, constraintType, out constraint, out constraintIndex);
 }