r2mods/ilspy_dump/ror2_csproj/RoR2.CharacterAI/AIOwnership.cs

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();
}
}
}