public static UnitAnimType GetUnitAnimType(string unitAnimTypeName) { V_Animation.Init(); foreach (UnitAnimType unitAnimType in unitAnimTypeList) { if (unitAnimType.name == unitAnimTypeName) { return(unitAnimType); } } Debug.LogWarning("#### UNIT ANIM TYPE NOT FOUND: " + unitAnimTypeName); return(null); }
public V_UnitSkeleton(float frameRateMod, DelConvertLocalPositionToWorldPosition ConvertLocalPositionToWorldPosition, Action <Mesh> SetMesh) { V_Animation.Init(); this.frameRateMod = frameRateMod; this.ConvertLocalPositionToWorldPosition = ConvertLocalPositionToWorldPosition; mesh = new Mesh(); List <Vector3> vertices = new List <Vector3>(); List <Vector2> uvs = new List <Vector2>(); List <int> triangles = new List <int>(); mesh.triangles = null; mesh.vertices = vertices.ToArray(); mesh.uv = uvs.ToArray(); mesh.triangles = triangles.ToArray(); SetMesh(mesh); PlayAnim(UnitAnim.DefaultAnimation, 1f, null, null, null); }