public void ScaleSelected(Vector3 Force, Vector3 Origin) { Vector3 Result = Vector3.Zero; bool Success = false; Basic3DObject.GetAveragePosition(SelectedGameObjects, ref Result, ref Success); foreach (GameObject g in SelectedGameObjects) { if (g.GetType().IsSubclassOf(typeof(Basic3DObject))) { Basic3DObject b = (Basic3DObject)g; b.ApplyScale(Force, Result, false); } } }
public void ApplyScale(Vector3 Force, Vector3 Origin, bool ApplyToChildren) { Scale.mult(Force); Position.set(Origin + (Position.get() - Origin) * Force); if (ApplyToChildren) { foreach (GameObject g in HierarchyChildren) #if EDITOR && WINDOWS { if (!ParentLevel.LevelForEditing || !g.EditorSelected) #endif if (g.GetType().IsSubclassOf(typeof(Basic3DObject))) { Basic3DObject b = (Basic3DObject)g; b.ApplyScale(Force, Origin, true); } } } }