根据提供的code differences信息,由于没有具体的代码变更内容,我将生成一个通用的commit message模板:
``` docs(readme): 更新文档说明 - 添加项目使用指南 - 完善API接口说明 - 修正错误的配置示例 ```
This commit is contained in:
1 parent
a74d1e62d7
commit
8d58c2223c
167 files changed
+1119
-15679
No files matched your search
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: CygW5yr+Wil0YVrsnTde7g4OAv0+ySsvpKJ8nCRqwxR5A+Z+Ncqsgxo=
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,76 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
[ExecuteAlways]
|
||||
public class AdjustableGlowOrb : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Color glowColor = new Color(0.1f, 0.65f, 1f, 1f);
|
||||
[SerializeField, Min(0f)] private float emissionIntensity = 2.5f;
|
||||
[SerializeField, Range(0f, 1f)] private float haloAlpha = 0.25f;
|
||||
[SerializeField] private Renderer targetRenderer;
|
||||
[Tooltip("光晕等附属渲染器,留空时自动收集子级(排除主体球)")]
|
||||
[SerializeField] private Renderer[] haloRenderers;
|
||||
|
||||
private MaterialPropertyBlock propertyBlock;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
ApplyVisuals();
|
||||
}
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
ApplyVisuals();
|
||||
}
|
||||
|
||||
public void SetGlowColor(Color color)
|
||||
{
|
||||
glowColor = color;
|
||||
ApplyVisuals();
|
||||
}
|
||||
|
||||
public Color GetGlowColor() => glowColor;
|
||||
|
||||
private void ApplyVisuals()
|
||||
{
|
||||
if (targetRenderer == null)
|
||||
{
|
||||
targetRenderer = GetComponent<Renderer>();
|
||||
}
|
||||
|
||||
if (haloRenderers == null || haloRenderers.Length == 0)
|
||||
{
|
||||
haloRenderers = GetComponentsInChildren<Renderer>(true);
|
||||
for (int i = 0; i < haloRenderers.Length; i++)
|
||||
{
|
||||
if (haloRenderers[i] == targetRenderer)
|
||||
{
|
||||
haloRenderers[i] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (targetRenderer != null)
|
||||
{
|
||||
propertyBlock ??= new MaterialPropertyBlock();
|
||||
targetRenderer.GetPropertyBlock(propertyBlock);
|
||||
Color emission = glowColor * emissionIntensity;
|
||||
propertyBlock.SetColor("_BaseColor", glowColor);
|
||||
propertyBlock.SetColor("_Color", glowColor);
|
||||
propertyBlock.SetColor("_EmissionColor", emission);
|
||||
targetRenderer.SetPropertyBlock(propertyBlock);
|
||||
}
|
||||
|
||||
if (haloRenderers == null) return;
|
||||
propertyBlock ??= new MaterialPropertyBlock();
|
||||
Color haloTint = new Color(glowColor.r, glowColor.g, glowColor.b, haloAlpha);
|
||||
foreach (Renderer halo in haloRenderers)
|
||||
{
|
||||
if (halo == null) continue;
|
||||
halo.GetPropertyBlock(propertyBlock);
|
||||
// Legacy Shaders/Particles/Additive 用 _TintColor 作为颜色入口
|
||||
propertyBlock.SetColor("_TintColor", haloTint);
|
||||
propertyBlock.SetColor("_Color", haloTint);
|
||||
halo.SetPropertyBlock(propertyBlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: Wy4WsSytUHKt4Lt/6y0foOFNb9+jGCSNOHfb7zNRXDP2CnmXS/mkpNM=
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,74 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
[ExecuteAlways]
|
||||
public class PortalEnergyVisual : MonoBehaviour
|
||||
{
|
||||
public enum PortalTeamColor
|
||||
{
|
||||
Neutral,
|
||||
Blue,
|
||||
Red
|
||||
}
|
||||
|
||||
[SerializeField] private PortalTeamColor teamColor = PortalTeamColor.Neutral;
|
||||
[SerializeField] private Color neutralColor = Color.white;
|
||||
[SerializeField] private Color blueColor = new Color(0.1f, 0.65f, 1f, 1f);
|
||||
[SerializeField] private Color redColor = new Color(1f, 0.12f, 0.08f, 1f);
|
||||
[SerializeField, Min(0f)] private float emissionIntensity = 2.2f;
|
||||
[SerializeField, Min(0f)] private float pulseSpeed = 1.6f;
|
||||
[SerializeField, Range(0f, 0.2f)] private float pulseAmount = 0.06f;
|
||||
[SerializeField] private Vector2 scrollSpeed = new Vector2(0f, -0.08f);
|
||||
|
||||
private Renderer targetRenderer;
|
||||
private MaterialPropertyBlock propertyBlock;
|
||||
private static readonly int BaseColorId = Shader.PropertyToID("_Color");
|
||||
private static readonly int TintColorId = Shader.PropertyToID("_TintColor");
|
||||
private static readonly int EmissionColorId = Shader.PropertyToID("_EmissionColor");
|
||||
private static readonly int MainTexStId = Shader.PropertyToID("_MainTex_ST");
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
targetRenderer = GetComponent<Renderer>();
|
||||
propertyBlock ??= new MaterialPropertyBlock();
|
||||
ApplyVisuals(0f);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
ApplyVisuals(Application.isPlaying ? Time.time : Time.realtimeSinceStartup);
|
||||
}
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
targetRenderer = GetComponent<Renderer>();
|
||||
propertyBlock ??= new MaterialPropertyBlock();
|
||||
ApplyVisuals(0f);
|
||||
}
|
||||
|
||||
public void SetTeamColor(PortalTeamColor color)
|
||||
{
|
||||
teamColor = color;
|
||||
ApplyVisuals(0f);
|
||||
}
|
||||
|
||||
public PortalTeamColor GetTeamColor() => teamColor;
|
||||
|
||||
private void ApplyVisuals(float time)
|
||||
{
|
||||
if (targetRenderer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Color color = teamColor == PortalTeamColor.Blue ? blueColor : teamColor == PortalTeamColor.Red ? redColor : neutralColor;
|
||||
float pulse = 1f + Mathf.Sin(time * pulseSpeed) * pulseAmount;
|
||||
Color emission = color * (emissionIntensity * pulse);
|
||||
|
||||
targetRenderer.GetPropertyBlock(propertyBlock);
|
||||
propertyBlock.SetColor(BaseColorId, color);
|
||||
propertyBlock.SetColor(TintColorId, color);
|
||||
propertyBlock.SetColor(EmissionColorId, emission);
|
||||
propertyBlock.SetVector(MainTexStId, new Vector4(1f, 1f, scrollSpeed.x * time, scrollSpeed.y * time));
|
||||
targetRenderer.SetPropertyBlock(propertyBlock);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: B3lNvC6vUihFXZRWfse+0pjfpFXfEHzGHbWso3vUnZsU4niV4zg0eu8=
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,102 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>混沌裂缝传送门:主层(静态椭圆框)+ 内层(原地波动),支持白/红/蓝三色切换。</summary>
|
||||
[ExecuteAlways]
|
||||
public class RiftPortalVisual : MonoBehaviour
|
||||
{
|
||||
[Header("裂缝渲染层(主层 + 内层)")]
|
||||
[SerializeField] private Renderer[] riftRenderers;
|
||||
[SerializeField] private Transform innerLayer;
|
||||
|
||||
[Header("颜色状态(配色与水晶矿一致)")]
|
||||
[SerializeField] private Color currentColor = Color.white;
|
||||
[SerializeField] private Color neutralColor = Color.white;
|
||||
[SerializeField] private Color blueColor = new Color(0.1f, 0.65f, 1f, 1f);
|
||||
[SerializeField] private Color redColor = new Color(1f, 0.12f, 0.08f, 1f);
|
||||
|
||||
[Header("原地波动动画(仅运行时,无位移无旋转)")]
|
||||
[SerializeField, Min(0f)] private float pulseSpeed = 2.2f;
|
||||
[Tooltip("内层整体缩放的呼吸幅度")]
|
||||
[SerializeField, Range(0f, 0.2f)] private float pulseAmplitude = 0.04f;
|
||||
[Tooltip("亮度明暗波动幅度 0~1")]
|
||||
[SerializeField, Range(0f, 1f)] private float glowPulseAmount = 0.25f;
|
||||
|
||||
private MaterialPropertyBlock propertyBlock;
|
||||
private Vector3 innerBaseScale;
|
||||
private bool baseScaleCached;
|
||||
|
||||
public Color CurrentColor => currentColor;
|
||||
|
||||
private void OnEnable() => ApplyColor();
|
||||
private void OnValidate() => ApplyColor();
|
||||
private void Reset() => CollectRenderers();
|
||||
|
||||
public void SetRiftColor(Color color)
|
||||
{
|
||||
currentColor = color;
|
||||
ApplyColor();
|
||||
}
|
||||
|
||||
/// <summary>teamId: 0=蓝, 1=红, 其他=白(中立),与水晶矿争夺语义一致。</summary>
|
||||
public void SetTeam(int teamId)
|
||||
{
|
||||
SetRiftColor(teamId == 0 ? blueColor : teamId == 1 ? redColor : neutralColor);
|
||||
}
|
||||
|
||||
private void ApplyColor(float brightness = 1f)
|
||||
{
|
||||
if (riftRenderers == null || riftRenderers.Length == 0)
|
||||
{
|
||||
CollectRenderers();
|
||||
}
|
||||
if (riftRenderers == null) return;
|
||||
|
||||
propertyBlock ??= new MaterialPropertyBlock();
|
||||
Color tint = new Color(
|
||||
currentColor.r * brightness,
|
||||
currentColor.g * brightness,
|
||||
currentColor.b * brightness,
|
||||
currentColor.a);
|
||||
foreach (Renderer renderer in riftRenderers)
|
||||
{
|
||||
if (renderer == null) continue;
|
||||
renderer.GetPropertyBlock(propertyBlock);
|
||||
// Legacy Shaders/Particles/Additive 用 _TintColor 作为颜色入口
|
||||
propertyBlock.SetColor("_TintColor", tint);
|
||||
propertyBlock.SetColor("_Color", tint);
|
||||
renderer.SetPropertyBlock(propertyBlock);
|
||||
}
|
||||
}
|
||||
|
||||
private void CollectRenderers()
|
||||
{
|
||||
riftRenderers = GetComponentsInChildren<Renderer>(true);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!Application.isPlaying) return;
|
||||
|
||||
float t = Time.time;
|
||||
float wave = Mathf.Sin(t * pulseSpeed);
|
||||
|
||||
// 内层整体缩放的轻微呼吸(围绕自身中心,原地)
|
||||
if (innerLayer != null)
|
||||
{
|
||||
if (!baseScaleCached)
|
||||
{
|
||||
innerBaseScale = innerLayer.localScale;
|
||||
baseScaleCached = true;
|
||||
}
|
||||
float pulse = 1f + wave * pulseAmplitude;
|
||||
innerLayer.localScale = new Vector3(
|
||||
innerBaseScale.x * pulse,
|
||||
innerBaseScale.y * pulse,
|
||||
innerBaseScale.z);
|
||||
}
|
||||
|
||||
// 亮度明暗波动(原地能量涌动)
|
||||
float brightness = 1f - glowPulseAmount * (0.5f - 0.5f * wave);
|
||||
ApplyColor(brightness);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: CXkevXyuVXK3/HnB5/z9a4Y79fVLS6U7O0KoLR/e8k37HSe2hluvhwI=
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user