Initialer Upload neues Unity-Projekt
This commit is contained in:
@ -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>();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 60b5cd27ba404cd42a0608590d0d6b96
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
11
Assets/Convai/Scripts/Runtime/Extensions/ImageExtensions.cs
Normal file
11
Assets/Convai/Scripts/Runtime/Extensions/ImageExtensions.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bde7d53e94e232744aa2b649f44847f5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
12
Assets/Convai/Scripts/Runtime/Extensions/RectExtension.cs
Normal file
12
Assets/Convai/Scripts/Runtime/Extensions/RectExtension.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e7bf1bb407e9f614ba1cdbc8ff01bdb0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -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));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3db3cb9745d4844fa122272c2f7b11d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user