public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem) { var define = DefineCenter.Instance().GetDefine(nodeTypeName).GetComponent <PathFindingNode>(); dstManager.AddComponentData(entity, new Component.AStarNode { Id = id, Cost = define.Cost }); }
public void GetDefinesOf_Correct() { DefineCenter.Instance().AddDefine("a", new IComponent[] { new MockComponentA() }); DefineCenter.Instance().AddDefine("b", new IComponent[] { new MockComponentA() }); DefineCenter.Instance().AddDefine("c", new IComponent[] { new MockComponentB() }); var result = DefineCenter.Instance().GetDefinesOf <MockComponentA>(); Assert.AreEqual(2, result.Length); Assert.AreEqual("a", result[0].GetName()); Assert.AreEqual("b", result[1].GetName()); }
public void UpdateNodeTypes() { var nodeTypeDefines = DefineCenter.Instance().GetDefinesOf <PathFindingNode>(); if (nodeTypeMaterials == null) { nodeTypeMaterials = new MaterialDictionary(); } foreach (var nodeTypeDefine in nodeTypeDefines) { if (!nodeTypeMaterials.ContainsKey(nodeTypeDefine.GetName())) { nodeTypeMaterials.Add(nodeTypeDefine.GetName(), null); } } }
public void TearDown() { DefineCenter.Instance().GetDefines().Clear(); }