26 lines
410 B
C#
26 lines
410 B
C#
using UnityEngine;
|
|
|
|
namespace RoR2.CharacterAI;
|
|
|
|
[RequireComponent(typeof(BaseAI))]
|
|
[DisallowMultipleComponent]
|
|
public class AIOwnership : MonoBehaviour
|
|
{
|
|
public CharacterMaster ownerMaster;
|
|
|
|
private BaseAI baseAI;
|
|
|
|
private void Awake()
|
|
{
|
|
baseAI = GetComponent<BaseAI>();
|
|
}
|
|
|
|
private void FixedUpdate()
|
|
{
|
|
if ((bool)ownerMaster)
|
|
{
|
|
baseAI.leader.gameObject = ownerMaster.GetBodyObject();
|
|
}
|
|
}
|
|
}
|