// Use this for initialization void Start() { if (boneBuffer == null) { boneBuffer = this.GetComponent <BoneBuffer>(); } if (vertBuffer == null) { vertBuffer = this.GetComponent <SkinnedVertBuffer>(); } if (triBuffer == null) { triBuffer = this.GetComponent <SkinnedTriangleBuffer>(); } vertCount = vertBuffer.count; _kernel = computeShader.FindKernel("CSMain"); numGroups = (vertCount + (numThreads - 1)) / numThreads; SetBegin(); mat = new Material(material); }
/// <summary> /// Changes the equip. /// </summary> /// <param name="part">Part.</param> /// <param name="szEquipName">Size equip name.</param> /// <param name="assetBundle">Asset bundle.</param> public void ChangeEquip(PartType part, GameObject equipMesh, StringHolder holder) { SkinnedMeshRenderer skinMeshRender = equipMesh.GetComponent<SkinnedMeshRenderer>(); if (!skinMeshRender) skinMeshRender = equipMesh.AddComponent<SkinnedMeshRenderer>(); m_dMesh [part] = new BoneBuffer ( skinMeshRender, holder ); // megre equip MegreEquip (); }
/// <summary> /// Changes the equip. /// </summary> /// <param name="part">Part.</param> /// <param name="szEquipName">Size equip name.</param> /// <param name="assetBundle">Asset bundle.</param> public virtual void ChangeEquip(PartType part, GameObject equipMesh, StringHolder holder) { /* if (part == PartType.PT_ARM) { Transform mount = GetMount(MountType.Dummy_R_HandGun); if (!mount) throw new System.NullReferenceException(MountType.Dummy_R_HandGun.ToString()); foreach(string content in holder.content) { Debug.Log(content); } } */ m_dMesh [part] = new BoneBuffer ( equipMesh.GetComponent<SkinnedMeshRenderer>(), holder ); // megre equip MegreEquip (); }