From 6aa872c92f9f227429356704d8473cec23ec31c5 Mon Sep 17 00:00:00 2001 From: Krazerleo Date: Sat, 7 May 2022 23:08:32 +0700 Subject: [PATCH] Runtime bot behavior instantiation --- Assets/Scripts/Bots/CharacterFactory.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Bots/CharacterFactory.cs b/Assets/Scripts/Bots/CharacterFactory.cs index 0ca7c1d..ba1f681 100644 --- a/Assets/Scripts/Bots/CharacterFactory.cs +++ b/Assets/Scripts/Bots/CharacterFactory.cs @@ -1,4 +1,6 @@ using System.Collections.Generic; +using Unity.Barracuda; +using Unity.MLAgents.Policies; using UnityEngine; public class CharacterFactory : MonoBehaviour @@ -70,7 +72,9 @@ public class CharacterFactory : MonoBehaviour } else { - gameobject.GetComponent().GetCharacter.Team = team; + var npc = gameobject.GetComponent(); + npc.GetCharacter.Team = team; + npc.SetModel(team.ToString(), ScriptableObject.CreateInstance(), InferenceDevice.Default ); gameobject.GetComponent().PointStartID = spawnPoint.PointId; bots.Add(gameobject); }