private void Awake() { BodyPartLoader.LoadBodyParts(); _ec = EntityTemplatesContainer.Load(Path); _entityTemplateTypes = new string[_ec.EntityTemplates.Count]; var index = 0; foreach (var e in _ec.EntityTemplates) { _entityTemplateTypes[index] = e.Type; index++; } }
public static EntityTemplate GetEntityTemplate(string entityTemplateType) { if (_ec == null) { BodyPartLoader.LoadBodyParts(); _ec = EntityTemplatesContainer.Load(Path); _entityTemplateTypes = new string[_ec.EntityTemplates.Count]; var i = 0; foreach (var e in _ec.EntityTemplates) { _entityTemplateTypes[i] = e.Type; i++; } } var index = _ec.EntityTemplates.FindIndex(item => item.Type.Equals(entityTemplateType.ToLower())); var et = _ec.EntityTemplates[index]; return(et); }