You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/DebugAddMember.cs

22 lines
519 B
C#

3 months ago
using D2D;
using Sirenix.OdinInspector;
using UnityEngine;
public class DebugAddMember : Unit
{
[SerializeField] private SquadMember squadMember;
private SquadComponent squadComponent;
private void Awake()
{
squadComponent = Get<SquadComponent>();
}
[Button]
public void AddMember()
{
var newMember = Instantiate(squadMember.gameObject, Vector3.forward, Quaternion.identity, transform).GetComponent<SquadMember>();
squadComponent.AddMember(newMember);
}
}