Esempio n. 1
0
        private SlotDataAsset CreateSlot_Internal()
        {
            var material = slotMaterial;

            if (slotName == null || slotName == "")
            {
                Debug.LogError("slotName must be specified.");
                return(null);
            }

            if (material == null)
            {
                Debug.LogWarning("No UMAMaterial specified, you need to specify that later.");
                return(null);
            }

            if (slotFolder == null)
            {
                Debug.LogError("Slot folder not supplied");
                return(null);
            }

            if (slotMesh == null)
            {
                Debug.LogError("Slot Mesh not supplied.");
                return(null);
            }

            Debug.Log("Slot Mesh: " + slotMesh.name, slotMesh.gameObject);
            SlotDataAsset slot = UMASlotProcessingUtil.CreateSlotData(AssetDatabase.GetAssetPath(slotFolder), GetAssetFolder(), GetAssetName(), slotMesh, material, normalReferenceMesh, RootBone);

            return(slot);
        }
Esempio n. 2
0
        private void UpdateSlotData(SkinnedMeshRenderer skinnedMesh)
        {
            SlotDataAsset slot = target as SlotDataAsset;

            string existingRootBone = slot.meshData.RootBoneName;

            UMASlotProcessingUtil.UpdateSlotData(slot, skinnedMesh, slot.material, null, existingRootBone);
        }
        private SlotDataAsset CreateSlot_Internal()
        {
            var material = slotMaterial;

            if (slotName == null || slotName == "")
            {
                Debug.LogError("slotName must be specified.");
                return(null);
            }

            if (material == null)
            {
                Debug.LogWarning("No UMAMaterial specified, you need to specify that later.");
                return(null);
            }

            if (slotFolder == null)
            {
                Debug.LogError("Slot folder not supplied");
                return(null);
            }

            if (slotMesh == null)
            {
                Debug.LogError("Slot Mesh not supplied.");
                return(null);
            }

            List <string> KeepList = new List <string>();

            foreach (BoneName b in KeepBones)
            {
                KeepList.Add(b.strValue);
            }

            SlotDataAsset slot = UMASlotProcessingUtil.CreateSlotData(AssetDatabase.GetAssetPath(slotFolder), GetAssetFolder(), GetAssetName(), GetSlotName(slotMesh), nameAfterMaterial, slotMesh, material, normalReferenceMesh, KeepList, RootBone, binarySerialization);

            slot.tags = Tags.ToArray();
            return(slot);
        }