本项目演示如何创建自己的顶点动画着色器。场景不使用任何纹理或动画资源,所有内容都使用Shader Graph进行着色和动画处理。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

31 行
990 B

using System;
using System.Collections.Generic;
using UnityEngine;
namespace UnityEditor.Recorder
{
[Serializable]
class AspectRatio
{
[SerializeField] float m_CustomAspectX = 1.0f;
[SerializeField] float m_CustomAspectY = 1.0f;
[SerializeField] ImageAspect m_ImageAspect = ImageAspect.x16_9;
internal static readonly Dictionary<ImageAspect, float> s_AspectToValue = new Dictionary<ImageAspect, float>
{
{ ImageAspect.x16_9, 16.0f / 9.0f },
{ ImageAspect.x16_10, 16.0f / 10.0f },
{ ImageAspect.x19_10, 19.0f / 10.0f },
{ ImageAspect.x5_4, 5.0f / 4.0f },
{ ImageAspect.x4_3, 4.0f / 3.0f },
{ ImageAspect.x3_2, 3.0f / 2.0f },
{ ImageAspect.x1_1, 1.0f }
};
public float GetAspect()
{
return m_ImageAspect == ImageAspect.Custom ? m_CustomAspectX / m_CustomAspectY : s_AspectToValue[m_ImageAspect];
}
}
}