```
feat(materials): 更新材质贴图纹理和缩放参数
- 修改CoreBattleGround.mat材质的MainTex纹理GUID为4435756e5310e408fb125e8f4bcee9bd
- 调整CoreBattleGround.mat材质中EmissionMap和MainTex的缩放比例从{x: 1, y: 1}改为{x: 3, y: 3}
fix(models): 调整建筑模型全局缩放比例
- 将主要基地模型的globalScale从3调整为5
- 将水晶矿模型的globalScale从1调整为7,对应骨骼缩放从1调整为0.07
- 将机械出兵点模型的globalScale从1调整为7,对应骨骼缩放从1调整为0.07
feat(textures): 为模型添加纹理贴图
- 为水晶矿模型材质添加MainTex纹理,GUID为c24a978a0c9ad4dabb831e4b2bff0e2f
- 为机械出兵点模型材质添加MainTex纹理,GUID为fb52fc095c9554db895dde01ba8a8b6c
```
This commit is contained in:
1 parent
7b037dd467
commit
0e7de5f885
57 files changed
+2434
-866
No files matched your search
@@ -0,0 +1,51 @@
|
||||
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] private Renderer targetRenderer;
|
||||
|
||||
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 (targetRenderer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: Wy4WsSytUHKt4Lt/6y0foOFNb9+jGCSNOHfb7zNRXDP2CnmXS/mkpNM=
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,74 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: B3lNvC6vUihFXZRWfse+0pjfpFXfEHzGHbWso3vUnZsU4niV4zg0eu8=
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user