protected override void constructed() { this.addToDebugDrawing(); multiProp = Owner.getElement(multiPropName) as MultiProp; if (multiProp == null) { blacklist("Cannot find MultiProp '{0}'", multiPropName); } multiProp.beginUpdates(); using (var stream = VirtualFileSystem.Instance.openStream("Plugins/SplintProps/PartModels/SplintSpace.positions", Engine.Resources.FileMode.Open)) { PositionCollection positions = new PositionCollection(stream); for (int i = StartIndex; i < EndIndex; ++i) { var position = positions.getPosition(String.Format("BaseSplint{0}", i)); multiProp.addSection(new MultiPropSection(String.Format("SplintSection{0}", i), String.Format("BaseSplint{0}.mesh", i), String.Format("BaseSplintCol{0}", i), position.Translation, position.Rotation, new Vector3(1f, 0.2f, 1f))); } } multiProp.finishUpdates(); base.constructed(); }
public override void update(Clock clock, EventManager eventManager) { multiProp.beginUpdates(); currentScale += 0.1f * clock.DeltaSeconds; currentScale %= 1.0f; woot3.Scale = new Vector3(1, currentScale, 1); woot3.updatePosition(); woot2.Translation = new Vector3(currentScale, 0, 0); woot2.updatePosition(); multiProp.finishUpdates(); }