- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace UnityStandardAssets.ImageEffects
|
|
{
|
|
/// A Utility class for performing various image based rendering tasks.
|
|
[AddComponentMenu("")]
|
|
public class ImageEffects
|
|
{
|
|
public static void RenderDistortion(Material material, RenderTexture source, RenderTexture destination, float angle, Vector2 center, Vector2 radius)
|
|
{
|
|
bool invertY = source.texelSize.y < 0.0f;
|
|
if (invertY)
|
|
{
|
|
center.y = 1.0f - center.y;
|
|
angle = -angle;
|
|
}
|
|
|
|
Matrix4x4 rotationMatrix = Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(0, 0, angle), Vector3.one);
|
|
|
|
material.SetMatrix("_RotationMatrix", rotationMatrix);
|
|
material.SetVector("_CenterRadius", new Vector4(center.x, center.y, radius.x, radius.y));
|
|
material.SetFloat("_Angle", angle*Mathf.Deg2Rad);
|
|
|
|
Graphics.Blit(source, destination, material);
|
|
}
|
|
|
|
|
|
[Obsolete("Use Graphics.Blit(source,dest) instead")]
|
|
public static void Blit(RenderTexture source, RenderTexture dest)
|
|
{
|
|
Graphics.Blit(source, dest);
|
|
}
|
|
|
|
|
|
[Obsolete("Use Graphics.Blit(source, destination, material) instead")]
|
|
public static void BlitWithMaterial(Material material, RenderTexture source, RenderTexture dest)
|
|
{
|
|
Graphics.Blit(source, dest, material);
|
|
}
|
|
}
|
|
}
|