// overrides public override void AssociateWithComponent(object obj) { base.AssociateWithComponent(obj); mComponent = (SkinnedMeshRenderer)obj; _material = GLexMaterial.Get(mComponent.sharedMaterials[0], mComponent); _submeshIndex = 0; mMesh = GLexMesh.Get(mComponent.sharedMesh); }
// overrides public override void AssociateWithComponent(object obj) { base.AssociateWithComponent(obj); mComponent = (MeshRenderer)obj; var meshFilter = mComponent.gameObject.GetComponent <MeshFilter>(); if (meshFilter != null) { Vector3 scale = meshFilter.transform.lossyScale; _mesh = GLexMesh.Get(meshFilter.sharedMesh); _mesh.Scale = scale; } _material = GLexMaterial.Get(mComponent.sharedMaterials[0], mComponent); _submeshIndex = 0; }