Runtime bot behavior instantiation
This commit is contained in:
@ -1,4 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Unity.Barracuda;
|
||||||
|
using Unity.MLAgents.Policies;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class CharacterFactory : MonoBehaviour
|
public class CharacterFactory : MonoBehaviour
|
||||||
@ -70,7 +72,9 @@ public class CharacterFactory : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gameobject.GetComponent<NPC>().GetCharacter.Team = team;
|
var npc = gameobject.GetComponent<NPC>();
|
||||||
|
npc.GetCharacter.Team = team;
|
||||||
|
npc.SetModel(team.ToString(), ScriptableObject.CreateInstance<NNModel>(), InferenceDevice.Default );
|
||||||
gameobject.GetComponent<MovementController>().PointStartID = spawnPoint.PointId;
|
gameobject.GetComponent<MovementController>().PointStartID = spawnPoint.PointId;
|
||||||
bots.Add(gameobject);
|
bots.Add(gameobject);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user