26 lines
612 B
C#
26 lines
612 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
|
|
public class PlayerInputHandler : MonoBehaviour
|
|
{
|
|
[SerializeField] private PlayerInputReference _playerInput;
|
|
[SerializeField] private List<PlayerInputReference> _inputs = new List<PlayerInputReference>();
|
|
|
|
public bool Boost => _inputs.Any(i => i.Boost());
|
|
public float Horizontal => _inputs.Select(i=>i.Horizontal()).Sum();
|
|
|
|
private void Awake()
|
|
{
|
|
Init();
|
|
}
|
|
|
|
private void Init()
|
|
{
|
|
foreach (var input in _inputs)
|
|
input.Init();
|
|
}
|
|
}
|