private void createLinearInputMoverBehaviorUI(MoverBehavior moverBehavior) { LinearInputMoverBehavior linearMover = moverBehavior as LinearInputMoverBehavior; if (linearMover != null) { EditorGUI.BeginChangeCheck(); Vector3 forwardStepSize = EditorGUILayout.Vector3Field("Forward Step Size", linearMover.getForwardStepSize()); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(linearMover, "Forward Step Size"); EditorUtility.SetDirty(linearMover); linearMover.setForwardStepSize(forwardStepSize); } EditorGUI.BeginChangeCheck(); Vector3 reverseStepSize = EditorGUILayout.Vector3Field("Reverse Step Size", linearMover.getReverseStepSize()); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(linearMover, "Reverse Step Size"); EditorUtility.SetDirty(linearMover); linearMover.setReverseStepSize(reverseStepSize); } } }
public override void initialize(MoverBehavior copiedBehavior) { LinearInputMoverBehavior copiedLinearInputBehavior = copiedBehavior as LinearInputMoverBehavior; if (copiedLinearInputBehavior != null) { m_data.copy(copiedLinearInputBehavior.m_data); } initialize(); }
//Every body two step forward IEnumerator resume() { isRewinding = true; yield return(new WaitForSeconds(timeBetweenRewinds)); foreach (GameObject car in carsSpawned) { if (car == null) { continue; } LinearInputMoverBehavior limb = car.GetComponent <LinearInputMoverBehavior>(); if (limb.getForwardStepSize().x < 0) { limb.setForwardStepSize(limb.getForwardStepSize() * -2f); } } rewinded = false; isRewinding = false; }