Exemplo n.º 1
0
    /// <summary>
    /// Init class method.
    /// </summary>
    private void Init()
    {
        // get player input script component reference.
        _playerInput = GetComponentInParent <FPSInput>();

        // get audio component.
        _audioComponent = GetComponent <AudioComponent>();

        // set default value for walking surface.
        currentSurface = WalkingSurfaces.Ground;
    }
Exemplo n.º 2
0
    /// <summary>
    /// Check surface type.
    /// Used to play different sound when moving.
    /// </summary>
    /// <param name="surfaceObject">GameObject - surface game object</param>
    private void CheckSurfaceType(GameObject surfaceObject)
    {
        switch (surfaceObject.tag)
        {
        case "GroundSurface":
            currentSurface = WalkingSurfaces.Ground;
            break;

        case "MetalSurface":
            currentSurface = WalkingSurfaces.Metal;
            break;

        default:
            currentSurface = WalkingSurfaces.Ground;
            break;
        }
    }