static void Main(string[] args) { AimCreateInfo aimCreateInfo = new AimCreateInfo() { configurationFilePath = "config/aim-config.json" }; AimLib.CreateInstance(); AimLib.Instance.Init(aimCreateInfo); AimBlackboardManager.CreateInstance(); AimBlackboardManager.Instance.Init(); AimAgentFactory.CreateInstance(); AimAgentFactory.Instance.Init(); List <AimFlockingAgent> agents = new List <AimFlockingAgent>(); for (int i = 0; i < 10; ++i) { AimFlockingAgent agent = AimAgentFactory.Instance.CreateAgent <AimFlockingAgent>(); agents.Add(agent); } while (true) { for (int i = 0; i < agents.Count; ++i) { agents[i].Flock(); agents[i].Update(); } } }
/// <summary> /// Initialize the Aim Library in accordance with create info structure. /// </summary> /// <returns></returns> public bool Init(AimCreateInfo aimCreateInfo) { AimLogger.CreateInstance(); AimLogger.Instance.Init(); AimLogger.Instance.LogInfo("Aim Initializing."); AimConfigManager.CreateInstance(); if (!AimConfigManager.Instance.Init(aimCreateInfo.configurationFilePath)) { AimLogger.Instance.LogError("Failed to Initialize Aim Config Manager."); } AimAgentFactory.CreateInstance(); if (!AimAgentFactory.Instance.Init()) { AimLogger.Instance.LogError("Failed to Initialize Aim Agent Factory."); } AimBlackboardManager.CreateInstance(); if (!AimBlackboardManager.Instance.Init()) { AimLogger.Instance.LogError("Failed to Initialize Aim Blackboard Manager."); } AimNavMeshGenerator.CreateInstance(); if (!AimNavMeshGenerator.Instance.Init()) { AimLogger.Instance.LogError("Failed to Initialize Aim NavMesh Generator."); } AimLogger.Instance.LogInfo("Aim Initialized Successfully."); return(true); }