45 lines
840 B
C#
45 lines
840 B
C#
using System;
|
|
using ECM2.Examples.FirstPerson;
|
|
using SoapCustomVariable;
|
|
using UnityEngine;
|
|
|
|
public class PlayerComponenetsController : MonoBehaviour
|
|
{
|
|
public FSMVariable PlayerState;
|
|
|
|
private CharacterLook _FPPLook;
|
|
|
|
private void Awake()
|
|
{
|
|
_FPPLook = GetComponent<CharacterLook>();
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
PlayerState.OnValueChanged += PlayerStateOnOnValueChanged;
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
PlayerState.OnValueChanged -= PlayerStateOnOnValueChanged;
|
|
}
|
|
|
|
private void PlayerStateOnOnValueChanged(State state)
|
|
{
|
|
switch (state)
|
|
{
|
|
case State.idle:
|
|
case State.move:
|
|
case State.prepare:
|
|
case State.casting:
|
|
case State.fishing:
|
|
case State.baitFlies:
|
|
case State.fight:
|
|
case State.collectFish:
|
|
case State.throwFish:
|
|
return;
|
|
}
|
|
throw new ArgumentOutOfRangeException("state", state, null);
|
|
}
|
|
}
|