Initialer Upload neues Unity-Projekt

This commit is contained in:
Daniel Ocks
2025-07-21 09:11:14 +02:00
commit eeca72985b
14558 changed files with 1508140 additions and 0 deletions

View File

@ -0,0 +1,9 @@
using UnityEngine;
public static class GameObjectExtension
{
public static T GetOrAddComponent<T>(this GameObject gameObject) where T : Component
{
return gameObject.TryGetComponent(out T t) ? t : gameObject.AddComponent<T>();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 60b5cd27ba404cd42a0608590d0d6b96
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,11 @@
using UnityEngine;
using UnityEngine.UI;
public static class ImageExtensions
{
public static Image WithColorValue(this Image image, float? r = null, float? g = null, float? b = null, float? a = null)
{
image.color = new Color(r ?? image.color.r, g ?? image.color.g, b ?? image.color.b, a ?? image.color.a);
return image;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bde7d53e94e232744aa2b649f44847f5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,12 @@
using UnityEngine;
namespace Convai.Scripts.Utils
{
public static class RectExtension
{
public static Rect With(this Rect rect, float? x = null, float? y = null, float? height = null, float? width = null)
{
return new Rect(x ?? rect.x, y ?? rect.y, width ?? rect.width, height ?? rect.height);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e7bf1bb407e9f614ba1cdbc8ff01bdb0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
using UnityEngine;
public static class SkinnedMeshRendererExtension
{
public static void SetBlendShapeWeightInterpolate(this SkinnedMeshRenderer renderer, int index, float value, float weight)
{
renderer.SetBlendShapeWeight(index, Mathf.Lerp(renderer.GetBlendShapeWeight(index), value, weight));
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e3db3cb9745d4844fa122272c2f7b11d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: