예제 #1
0
    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);
            }
        }
    }
예제 #2
0
    public override void initialize(MoverBehavior copiedBehavior)
    {
        LinearInputMoverBehavior copiedLinearInputBehavior = copiedBehavior as LinearInputMoverBehavior;

        if (copiedLinearInputBehavior != null)
        {
            m_data.copy(copiedLinearInputBehavior.m_data);
        }
        initialize();
    }
예제 #3
0
    //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;
    }