//public override void AddCaster(CasterItem caster) //{ // base.AddCaster(caster); //} public override void RemoveCaster(CasterItem caster) { base.RemoveCaster(caster); if (lastPoses.ContainsKey(caster.idx)) { lastPoses.Remove(caster.idx); } }
public virtual void RemoveCaster(CasterItem caster) { if (wldVertex.ContainsKey(caster.idx)) { wldVertex.Remove(caster.idx); tris.Remove(caster.idx); casters.Remove(caster); dirty = true; } }
void RefreshCaster(CasterItem caster) { int count = caster.mesh.vertexCount; Transform tr = caster.tr; Vector3[] vertex = caster.mesh.vertices; Vector3[] newVertex = wldVertex[caster.idx]; for (int i = 0; i < count; i++) { newVertex[i] = tr.localToWorldMatrix.MultiplyPoint3x4(vertex[i]); } }
public virtual void AddCaster(CasterItem caster) { if (wldVertex.ContainsKey(caster.idx)) { return; } else { TransformCaster(caster); casters.Add(caster); dirty = true; } }
protected virtual void TransformCaster(CasterItem caster) { int count = caster.mesh.vertexCount; Transform tr = caster.tr; Vector3[] vertex = caster.mesh.vertices; Vector3[] newVertex = new Vector3[count]; for (int i = 0; i < count; i++) { newVertex[i] = tr.localToWorldMatrix.MultiplyPoint3x4(vertex[i]); } wldVertex.Add(caster.idx, newVertex); tris.Add(caster.idx, caster.mesh.triangles); }
public static void RemoveCaster(CasterItem caster) { if (One == null) { return; } if (caster.kind == CasterKind.dynamicCaster) { One.dynamicCaster.RemoveCaster(caster); } else if (caster.kind == CasterKind.staticCaster) { One.staticCaster.RemoveCaster(caster); } }
protected override void TransformCaster(CasterItem caster) { base.TransformCaster(caster); lastPoses.Add(caster.idx, caster.tr.position); }