Stop() public method

public Stop ( ) : void
return void
Exemplo n.º 1
0
    /// <summary>
    /// resets all the springs to their default positions, i.e.
    /// for when loading a new camera or switching a weapon
    /// </summary>
    public virtual void SnapSprings()
    {
        if (m_PositionSpring != null)
        {
            m_PositionSpring.RestState = PositionOffset - PositionPivot;
            m_PositionSpring.State     = PositionOffset - PositionPivot;
            m_PositionSpring.Stop(true);
        }
        if (m_WeaponGroup != null)
        {
            m_WeaponGroupTransform.localPosition = PositionOffset - PositionPivot;
        }

        if (m_PositionPivotSpring != null)
        {
            m_PositionPivotSpring.RestState = PositionPivot;
            m_PositionPivotSpring.State     = PositionPivot;
            m_PositionPivotSpring.Stop(true);
        }
        Transform.localPosition = PositionPivot;

        if (m_PositionSpring2 != null)
        {
            m_PositionSpring2.RestState = Vector3.zero;
            m_PositionSpring2.State     = Vector3.zero;
            m_PositionSpring2.Stop(true);
        }

        if (m_RotationPivotSpring != null)
        {
            m_RotationPivotSpring.RestState = RotationPivot;
            m_RotationPivotSpring.State     = RotationPivot;
            m_RotationPivotSpring.Stop(true);
        }
        Transform.localEulerAngles = RotationPivot;

        if (m_RotationSpring != null)
        {
            m_RotationSpring.RestState = RotationOffset;
            m_RotationSpring.State     = RotationOffset;
            m_RotationSpring.Stop(true);
        }

        if (m_RotationSpring2 != null)
        {
            m_RotationSpring2.RestState = Vector3.zero;
            m_RotationSpring2.State     = Vector3.zero;
            m_RotationSpring2.Stop(true);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// resets all the springs to their default positions, i.e.
    /// for when loading a new camera or switching a weapon
    /// </summary>
    public virtual void SnapSprings()
    {
        if (m_PositionSpring2 != null)
        {
            m_PositionSpring2.RestState = Vector3.zero;
            m_PositionSpring2.State     = Vector3.zero;
            m_PositionSpring2.Stop(true);
        }

        if (m_RotationSpring2 != null)
        {
            m_RotationSpring2.RestState = m_RotationSpring2DefaultRotation;
            m_RotationSpring2.State     = m_RotationSpring2DefaultRotation;
            m_RotationSpring2.Stop(true);
        }
    }
Exemplo n.º 3
0
    ///////////////////////////////////////////////////////////
    // resets all the springs to their default positions, i.e.
    // for when loading a new camera or switching a weapon
    ///////////////////////////////////////////////////////////
    public void SnapSprings()
    {
        if (m_PositionSpring != null)
        {
            m_PositionSpring.RestState = PositionOffset;
            m_PositionSpring.State     = PositionOffset;
            m_PositionSpring.Stop();
        }

        if (m_RotationSpring != null)
        {
            m_RotationSpring.RestState = Vector3.zero;
            m_RotationSpring.State     = Vector3.zero;
            m_RotationSpring.Stop();
        }
    }
Exemplo n.º 4
0
    ///////////////////////////////////////////////////////////
    // resets all the springs to their default positions, i.e.
    // for when loading a new camera or switching a weapon
    ///////////////////////////////////////////////////////////
    public void SnapSprings()
    {
        if (m_PositionSpring != null)
        {
            m_PositionSpring.RestState = PositionOffset - PositionPivot;
            m_PositionSpring.State     = PositionOffset - PositionPivot;
            m_PositionSpring.Stop();
        }
        if (m_WeaponGroup != null)
        {
            m_WeaponGroup.transform.localPosition = PositionOffset - PositionPivot;
        }

        if (m_PositionPivotSpring != null)
        {
            m_PositionPivotSpring.RestState = PositionPivot;
            m_PositionPivotSpring.State     = PositionPivot;
            m_PositionPivotSpring.Stop();
        }
        transform.localPosition = PositionPivot;

        if (m_PositionSpring2 != null)
        {
            m_PositionSpring2.RestState = Vector3.zero;
            m_PositionSpring2.State     = Vector3.zero;
            m_PositionSpring2.Stop();
        }

        if (m_RotationSpring != null)
        {
            m_RotationSpring.RestState = RotationOffset;
            m_RotationSpring.State     = RotationOffset;
            m_RotationSpring.Stop();
        }

        if (m_RotationSpring2 != null)
        {
            m_RotationSpring2.RestState = Vector3.zero;
            m_RotationSpring2.State     = Vector3.zero;
            m_RotationSpring2.Stop();
        }
    }
Exemplo n.º 5
0
    ///////////////////////////////////////////////////////////
    // stops all the springs
    ///////////////////////////////////////////////////////////
    public void StopSprings()
    {
        if (m_PositionSpring != null)
        {
            m_PositionSpring.Stop();
        }

        if (m_PositionSpring2 != null)
        {
            m_PositionSpring2.Stop();
        }

        if (m_RotationSpring != null)
        {
            m_RotationSpring.Stop();
        }
    }