initial commit

This commit is contained in:
2026-05-29 18:21:53 +03:00
commit 66ddf0ead0
2184 changed files with 1384338 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: e862ecde714eb154ca2d86a9a0809732
folderAsset: yes
timeCreated: 1453372226
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,62 @@
using UnityEngine;
using UnityEditor;
using System;
using System.Linq.Expressions;
using System.Reflection;
namespace UnityStandardAssets.CinematicEffects
{
public static class EditorGUIHelper
{
private static Styles s_Styles;
private class Styles
{
public GUIStyle header = "ShurikenModuleTitle";
public GUIStyle headerCheckbox = "ShurikenCheckMark";
internal Styles()
{
header.font = (new GUIStyle("Label")).font;
header.border = new RectOffset(15, 7, 4, 4);
header.fixedHeight = 22;
header.contentOffset = new Vector2(20f, -2f);
}
}
static EditorGUIHelper()
{
s_Styles = new Styles();
}
public static bool Header(SerializedProperty group, SerializedProperty enabledField)
{
var display = group == null || group.isExpanded;
var enabled = enabledField != null && enabledField.boolValue;
var title = group == null ? "Unknown Group" : ObjectNames.NicifyVariableName(group.displayName);
Rect rect = GUILayoutUtility.GetRect(16f, 22f, s_Styles.header);
GUI.Box(rect, title, s_Styles.header);
Rect toggleRect = new Rect(rect.x + 4f, rect.y + 4f, 13f, 13f);
if (Event.current.type == EventType.Repaint)
s_Styles.headerCheckbox.Draw(toggleRect, false, false, enabled, false);
Event e = Event.current;
if (e.type == EventType.MouseDown)
{
if (toggleRect.Contains(e.mousePosition) && enabledField != null)
{
enabledField.boolValue = !enabledField.boolValue;
e.Use();
}
else if (rect.Contains(e.mousePosition) && group != null)
{
display = !display;
group.isExpanded = !group.isExpanded;
e.Use();
}
}
return display;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5b995f06a3ed14d449823cf7ab1c5a58
timeCreated: 1454681943
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,25 @@
using System;
using System.Linq.Expressions;
using System.Reflection;
namespace UnityStandardAssets.CinematicEffects
{
public static class FieldFinder<T>
{
public static FieldInfo GetField<TValue>(Expression<Func<T, TValue>> selector)
{
Expression body = selector;
if (body is LambdaExpression)
{
body = ((LambdaExpression)body).Body;
}
switch (body.NodeType)
{
case ExpressionType.MemberAccess:
return (FieldInfo)((MemberExpression)body).Member;
default:
throw new InvalidOperationException();
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 39e54cb37a3a81a40b248f1cc25c4619
timeCreated: 1454073160
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,29 @@
using UnityEditor;
using UnityEngine;
namespace UnityStandardAssets.CinematicEffects
{
[CustomPropertyDrawer(typeof(MinAttribute))]
internal sealed class MinDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
MinAttribute attribute = (MinAttribute) base.attribute;
if (property.propertyType == SerializedPropertyType.Integer)
{
int v = EditorGUI.IntField(position, label, property.intValue);
property.intValue = (int)Mathf.Max(v, attribute.min);
}
else if (property.propertyType == SerializedPropertyType.Float)
{
float v = EditorGUI.FloatField(position, label, property.floatValue);
property.floatValue = Mathf.Max(v, attribute.min);
}
else
{
EditorGUI.LabelField(position, label.text, "Use Min with float or int.");
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9c615a85f13c6764fa4496d1d7f75f52
timeCreated: 1453220014
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,67 @@
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace UnityStandardAssets.CinematicEffects
{
public static class ImageEffectHelper
{
public static bool IsSupported(Shader s, bool needDepth, bool needHdr, MonoBehaviour effect)
{
#if UNITY_EDITOR
// Don't check for shader compatibility while it's building as it would disable most effects
// on build farms without good-enough gaming hardware.
if (!BuildPipeline.isBuildingPlayer)
{
#endif
if (s == null || !s.isSupported)
{
Debug.LogWarningFormat("Missing shader for image effect {0}", effect);
return false;
}
#if UNITY_5_5_OR_NEWER
if (!SystemInfo.supportsImageEffects)
#else
if (!SystemInfo.supportsImageEffects || !SystemInfo.supportsRenderTextures)
#endif
{
Debug.LogWarningFormat("Image effects aren't supported on this device ({0})", effect);
return false;
}
if (needDepth && !SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.Depth))
{
Debug.LogWarningFormat("Depth textures aren't supported on this device ({0})", effect);
return false;
}
if (needHdr && !SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGBHalf))
{
Debug.LogWarningFormat("Floating point textures aren't supported on this device ({0})", effect);
return false;
}
#if UNITY_EDITOR
}
#endif
return true;
}
public static Material CheckShaderAndCreateMaterial(Shader s)
{
if (s == null || !s.isSupported)
return null;
var material = new Material(s);
material.hideFlags = HideFlags.DontSave;
return material;
}
public static bool supportsDX11
{
get { return SystemInfo.graphicsShaderLevel >= 50 && SystemInfo.supportsComputeShaders; }
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ab6a3f50deeee984c88794eeeb901226
timeCreated: 1448544124
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,14 @@
namespace UnityStandardAssets.CinematicEffects
{
using UnityEngine;
public sealed class MinAttribute : PropertyAttribute
{
public readonly float min;
public MinAttribute(float min)
{
this.min = min;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b07292ae638766047a6751da7552e566
timeCreated: 1453220005
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
using System.Collections.Generic;
using UnityEngine;
namespace UnityStandardAssets.CinematicEffects
{
public class RenderTextureUtility
{
//Temporary render texture handling
private List<RenderTexture> m_TemporaryRTs = new List<RenderTexture>();
public RenderTexture GetTemporaryRenderTexture(int width, int height, int depthBuffer = 0, RenderTextureFormat format = RenderTextureFormat.ARGBHalf, FilterMode filterMode = FilterMode.Bilinear)
{
var rt = RenderTexture.GetTemporary(width, height, depthBuffer, format);
rt.filterMode = filterMode;
rt.wrapMode = TextureWrapMode.Clamp;
rt.name = "RenderTextureUtilityTempTexture";
m_TemporaryRTs.Add(rt);
return rt;
}
public void ReleaseTemporaryRenderTexture(RenderTexture rt)
{
if (rt == null)
return;
if (!m_TemporaryRTs.Contains(rt))
{
Debug.LogErrorFormat("Attempting to remove texture that was not allocated: {0}", rt);
return;
}
m_TemporaryRTs.Remove(rt);
RenderTexture.ReleaseTemporary(rt);
}
public void ReleaseAllTemporaryRenderTextures()
{
for (int i = 0; i < m_TemporaryRTs.Count; ++i)
RenderTexture.ReleaseTemporary(m_TemporaryRTs[i]);
m_TemporaryRTs.Clear();
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 054e694bae00c374a97c2bc495fca66b
timeCreated: 1449148391
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: