You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.4 KiB
50 lines
1.4 KiB
1 year ago
|
using JetBrains.Annotations;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.AI;
|
||
|
|
||
|
namespace Moloch
|
||
|
{
|
||
|
public class LocomotionSM : StateMachine
|
||
|
{
|
||
|
// List of States
|
||
|
[HideInInspector]
|
||
|
public IdleState m_idleState;
|
||
|
[HideInInspector]
|
||
|
public WanderState m_wanderState;
|
||
|
[HideInInspector]
|
||
|
public PullingState m_PullingState;
|
||
|
|
||
|
|
||
|
[HideInInspector]
|
||
|
public Animator m_Animator;
|
||
|
[HideInInspector]
|
||
|
public NMAgentManager m_NavMeshAgent;
|
||
|
[HideInInspector]
|
||
|
public PhysicsOverlapManager m_PhysicsOverlapManager;
|
||
|
[HideInInspector]
|
||
|
public IKManager m_IKManager;
|
||
|
|
||
|
private void Awake()
|
||
|
{
|
||
|
// Instantiate new states, while passing in the SM
|
||
|
m_Animator = GetComponent<Animator>();
|
||
|
m_IKManager = GetComponent<IKManager>();
|
||
|
m_PhysicsOverlapManager = GetComponent<PhysicsOverlapManager>();
|
||
|
m_NavMeshAgent = new NMAgentManager(this.GetComponent<NavMeshAgent>(), this.gameObject, GameObject.Find("Ground").GetComponent<MeshRenderer>());
|
||
|
|
||
|
|
||
|
m_idleState = new IdleState(this);
|
||
|
m_wanderState = new WanderState(this);
|
||
|
m_PullingState = new PullingState(this);
|
||
|
}
|
||
|
|
||
|
protected override BaseState GetInitialState()
|
||
|
{
|
||
|
return m_PullingState;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|