squash commits

This commit is contained in:
2025-01-07 18:54:46 +02:00
parent 855639487b
commit 62c0a21987
3632 changed files with 708443 additions and 999 deletions
@@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9448878e2e40f1a4c9f8fd2b56832b13, type: 3}
m_Name: CapsuleColliderRecipe
m_EditorClassIdentifier:
label:
resourcesOnly: 0
recipeType: Standard
DisplayValue:
compatibleRaces: []
wardrobeRecipeThumbs: []
wardrobeSlot: None
Appended: 0
Hides: []
HideTags: []
suppressWardrobeSlots: []
activeWardrobeSet: []
MeshHideAssets: []
OverrideDNA:
PreloadValues: []
recipeString: '{"version":2,"packedSlotDataList":null,"slotsV2":[{"id":"CapsuleCollider","scale":100,"copyIdx":-1,"overlays":[]}],"colors":[],"sharedColorCount":0,"race":null,"umaDna":{},"packedDna":[]}'
@@ -0,0 +1,17 @@
fileFormatVersion: 2
guid: 1f292487d7383514f97c491cadfb0442
labels:
- UMA_Text Recipe
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 35611
packageName: UMA 2
packageVersion: 2.13
assetPath: Assets/UMA/Content/Example/AdditionalSlots/CapsuleCollider/CapsuleColliderRecipe.asset
uploadId: 679826
@@ -0,0 +1,53 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &193108
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 493108}
- 114: {fileID: 11493108}
m_Layer: 0
m_Name: CapsuleColliderScriptPrefab
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &493108
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 193108}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!114 &11493108
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 193108}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 36a86667c9c2f4345b84408aca89f102, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 193108}
m_IsPrefabParent: 1
m_IsExploded: 1
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 65cbab4980599e142b1ac6f6dd299e5f
NativeFormatImporter:
userData:
AssetOrigin:
serializedVersion: 1
productId: 35611
packageName: UMA 2
packageVersion: 2.13
assetPath: Assets/UMA/Content/Example/AdditionalSlots/CapsuleCollider/CapsuleColliderScriptPrefab.prefab
uploadId: 679826
@@ -0,0 +1,17 @@
fileFormatVersion: 2
guid: 04442629189f10a48bc3238f44aa9856
labels:
- UMA_Slot
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 35611
packageName: UMA 2
packageVersion: 2.13
assetPath: Assets/UMA/Content/Example/AdditionalSlots/CapsuleCollider/CapsuleColliderSlot.asset
uploadId: 679826
@@ -0,0 +1,79 @@
using UnityEngine;
namespace UMA
{
/// <summary>
/// Auxillary slot which adds a CapsuleCollider and Rigidbody to a newly created character.
/// </summary>
public class CapsuleColliderSlotScript : MonoBehaviour
{
public bool overrideMass = false;
public bool overrideConstraints = false;
public bool overrideDimensions = true;
public void OnDnaApplied(UMAData umaData)
{
var rigid = umaData.gameObject.GetComponent<Rigidbody>();
if (rigid == null)
{
rigid = umaData.gameObject.AddComponent<Rigidbody>();
rigid.constraints = RigidbodyConstraints.FreezeRotation;
rigid.mass = umaData.characterMass;
}
if ( overrideConstraints)
{
rigid.constraints = RigidbodyConstraints.FreezeRotation;
}
if (overrideMass)
{
rigid.mass = umaData.characterMass;
}
CapsuleCollider capsule = umaData.gameObject.GetComponent<CapsuleCollider>();
BoxCollider box = umaData.gameObject.GetComponent<BoxCollider>();
if(umaData.umaRecipe.raceData.umaTarget == RaceData.UMATarget.Humanoid)
{
if (capsule == null)
{
capsule = umaData.gameObject.AddComponent<CapsuleCollider>();
}
if( box != null )
{
Destroy(box);
}
if (overrideDimensions)
{
capsule.radius = umaData.characterRadius;
capsule.height = umaData.characterHeight;
capsule.center = new Vector3(0, capsule.height / 2, 0);
}
}
else
{
if (box == null)
{
box = umaData.gameObject.AddComponent<BoxCollider>();
}
if(capsule != null)
{
Destroy(capsule);
}
//with skycar this capsule collider makes no sense so we need the bounds to figure out what the size of the box collider should be
//we will assume that renderer 0 is the base renderer
var umaRenderer = umaData.GetRenderer(0);
if (umaRenderer != null)
{
if (overrideDimensions)
{
box.size = umaRenderer.bounds.size;
box.center = umaRenderer.bounds.center;
}
}
}
}
}
}
@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: 36a86667c9c2f4345b84408aca89f102
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
AssetOrigin:
serializedVersion: 1
productId: 35611
packageName: UMA 2
packageVersion: 2.13
assetPath: Assets/UMA/Content/Example/AdditionalSlots/CapsuleCollider/CapsuleColliderSlotScript.cs
uploadId: 679826