chore(plastic): 更新 Plastic SCM 配置文件

更新了 .plastic/plastic.changes 和 .plastic/plastic.wktree
二进制配置文件以同步工作区状态。
```
This commit is contained in:
huadexuan committed 2026-08-23 23:50:58 +08:00
1 parent fac62a5560
commit 83263c1d21
12 files changed
+192 -461

No files matched your search

Binary file not shown.
Binary file not shown.
@@ -267,6 +267,7 @@ MonoBehaviour:
range: 18
detectRange: 20
attackRange: 1
attackPower: 10
attackDuration: 1.5
target: {fileID: 903389984}
--- !u!143 &903389988
@@ -313,6 +314,8 @@ MonoBehaviour:
barWidth: 1.2
borderColor: {r: 0.03, g: 0.03, b: 0.03, a: 0.95}
fillColor: {r: 0.1, g: 0.8, b: 0.18, a: 1}
deathEffectDuration: 1.1
deathEffectColor: {r: 0.1, g: 0.55, b: 1, a: 1}
--- !u!1 &963194225
GameObject:
m_ObjectHideFlags: 0
@@ -569,6 +572,7 @@ MonoBehaviour:
range: 18
detectRange: 20
attackRange: 1
attackPower: 20
attackDuration: 2
target: {fileID: 989436104}
--- !u!114 &989436109
@@ -589,6 +593,8 @@ MonoBehaviour:
barWidth: 1.2
borderColor: {r: 0.03, g: 0.03, b: 0.03, a: 0.95}
fillColor: {r: 0.1, g: 0.8, b: 0.18, a: 1}
deathEffectDuration: 1.1
deathEffectColor: {r: 0.1, g: 0.55, b: 1, a: 1}
--- !u!1 &1178637744
GameObject:
m_ObjectHideFlags: 0
File renamed without changes.
+49 -12
View File
@@ -20,6 +20,10 @@ public class NewBehaviourScript : MonoBehaviour
//攻击范围
public float attackRange = 5f;
//基础攻击力,实际伤害结算逻辑后续接入
[Min(0f)]
public float attackPower = 10f;
//完整攻击动作时长,单位为秒;设置为0时使用动画真实时长
[Min(0f)]
public float attackDuration = 0f;
@@ -45,6 +49,9 @@ public class NewBehaviourScript : MonoBehaviour
//垂直速度
private float verticalVelocity;
//当前攻击的伤害结算协程。
private Coroutine attackDamageCoroutine;
//状态枚举
public enum State
{
@@ -106,17 +113,10 @@ public class NewBehaviourScript : MonoBehaviour
return;
}
//没有目标时回到巡逻
//场上没有敌人时进入待机,不再巡逻移动
state = State.Alert;
move(targetPos - transform.position);
//到达目标点时候随机目标点,只判断水平距离
Vector3 patrolOffset = transform.position - targetPos;
patrolOffset.y = 0;
if (patrolOffset.sqrMagnitude < 0.01f)
{
randomTargetPos();
}
animator.SetInteger("speed", 0);
applyGravity();
}
//根据自身Tag找到敌对Tag
@@ -248,15 +248,51 @@ public class NewBehaviourScript : MonoBehaviour
//根据目标攻击时长加速或减速完整攻击动画
SetAttackAnimationSpeed();
animator.SetInteger("speed", 0);
animator.SetTrigger("attack");
state = State.Attack;
//在攻击动画中段结算伤害,而不是在动画开始瞬间扣血。
if (attackDamageCoroutine != null)
{
StopCoroutine(attackDamageCoroutine);
}
attackDamageCoroutine = StartCoroutine(ApplyAttackDamageInMiddle(friend));
}
//等待半个完整攻击时长后,对目标扣除攻击力。
private IEnumerator ApplyAttackDamageInMiddle(GameObject friend)
{
float fullAttackDuration = attackDuration > 0f
? attackDuration
: Mathf.Max(GetAttackAnimationDuration(), 0.01f);
yield return new WaitForSeconds(fullAttackDuration * 0.5f);
if (friend != null)
{
WorldHealthBar healthBar = friend.GetComponentInParent<WorldHealthBar>();
if (healthBar != null)
{
healthBar.TakeDamage(attackPower);
}
}
attackDamageCoroutine = null;
}
// 在 Animator 的 Attack 动画结束时调用此方法
public void OnAttackAnimationEnd()
{
if (attackDamageCoroutine != null)
{
StopCoroutine(attackDamageCoroutine);
attackDamageCoroutine = null;
}
//攻击动画结束后恢复Animator速度
animator.speed = 1f;
@@ -268,9 +304,10 @@ public class NewBehaviourScript : MonoBehaviour
return;
}
//目标离开攻击范围,回到追踪或巡逻逻辑
//目标离开攻击范围,回到待机逻辑
state = State.Alert;
randomTargetPos();
animator.SetInteger("speed", 0);
applyGravity();
}
+137
View File
@@ -21,6 +21,12 @@ public class WorldHealthBar : MonoBehaviour
// 血条内部填充颜色。
public Color fillColor = new Color(0.1f, 0.8f, 0.18f, 1f);
// 死亡特效持续时间,单位为秒。
[Min(0.1f)] public float deathEffectDuration = 1.1f;
// 死亡时使用的浅蓝色粒子颜色。
public Color deathEffectColor = new Color(0.55f, 0.9f, 1f, 1f);
// 血条 UI 的像素尺寸,实际显示大小由 worldWidth 控制。
private const int PixelWidth = 100;
private const int PixelHeight = 14;
@@ -43,6 +49,9 @@ public class WorldHealthBar : MonoBehaviour
// 所有血条共用的圆角 Sprite。
private static Sprite roundedSprite;
// 防止死亡逻辑重复执行。
private bool isDead;
// 初始化血量和血条 UI。
private void Awake()
{
@@ -99,8 +108,14 @@ public class WorldHealthBar : MonoBehaviour
// 直接设置当前生命值,并刷新绿色填充比例。
public void SetHealth(float value)
{
if (isDead) return;
currentHealth = Mathf.Clamp(value, 0f, maxHealth);
UpdateFill();
if (currentHealth <= 0f)
{
Die();
}
}
// 让单位受到伤害。
@@ -109,6 +124,128 @@ public class WorldHealthBar : MonoBehaviour
// 让单位恢复生命值。
public void Heal(float amount) => SetHealth(currentHealth + amount);
// 处理单位死亡:隐藏模型和血条,播放蓝色向上爆散特效。
private void Die()
{
isDead = true;
currentHealth = 0f;
UpdateFill();
foreach (Renderer renderer in GetComponentsInChildren<Renderer>())
{
renderer.enabled = false;
}
// 立即从敌我扫描中移除,避免死亡等待期间继续被攻击。
gameObject.SetActive(false);
if (barRect != null)
{
barRect.gameObject.SetActive(false);
}
GameObject effect = CreateDeathEffect();
Destroy(effect, deathEffectDuration);
Destroy(gameObject, deathEffectDuration);
}
// 创建蓝色粒子爆散特效。
private GameObject CreateDeathEffect()
{
GameObject effect = new GameObject("DeathEffect");
effect.transform.position = transform.position + Vector3.up * 1.35f;
ParticleSystem particles = effect.AddComponent<ParticleSystem>();
particles.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
var main = particles.main;
main.playOnAwake = false;
main.duration = deathEffectDuration;
main.startLifetime = new ParticleSystem.MinMaxCurve(0.9f, deathEffectDuration);
main.startSpeed = new ParticleSystem.MinMaxCurve(0.05f, 0.18f);
main.startSize = new ParticleSystem.MinMaxCurve(0.09f, 0.2f);
main.startRotation3D = true;
main.startRotationX = new ParticleSystem.MinMaxCurve(0f, 6.28f);
main.startRotationY = new ParticleSystem.MinMaxCurve(0f, 6.28f);
main.startRotationZ = new ParticleSystem.MinMaxCurve(0f, 6.28f);
main.startColor = deathEffectColor;
main.maxParticles = 32;
main.gravityModifier = new ParticleSystem.MinMaxCurve(1.6f);
main.simulationSpace = ParticleSystemSimulationSpace.World;
main.stopAction = ParticleSystemStopAction.None;
var emission = particles.emission;
emission.rateOverTime = 0f;
emission.SetBursts(new[] { new ParticleSystem.Burst(0f, 18) });
var shape = particles.shape;
shape.shapeType = ParticleSystemShapeType.Sphere;
shape.radius = 0.12f;
// 只保留轻微水平散落,主要依靠重力向下坠落。
var velocity = particles.velocityOverLifetime;
velocity.enabled = true;
velocity.space = ParticleSystemSimulationSpace.World;
velocity.x = new ParticleSystem.MinMaxCurve(-0.08f, 0.08f);
velocity.y = new ParticleSystem.MinMaxCurve(-0.25f, -0.05f);
velocity.z = new ParticleSystem.MinMaxCurve(-0.08f, 0.08f);
var collision = particles.collision;
collision.enabled = true;
collision.type = ParticleSystemCollisionType.World;
collision.mode = ParticleSystemCollisionMode.Collision3D;
collision.bounce = 0f;
collision.lifetimeLoss = 0.15f;
var size = particles.sizeOverLifetime;
size.enabled = true;
AnimationCurve fade = new AnimationCurve(
new Keyframe(0f, 1f),
new Keyframe(0.75f, 1f),
new Keyframe(1f, 0f));
size.size = new ParticleSystem.MinMaxCurve(1f, fade);
var renderer = effect.GetComponent<ParticleSystemRenderer>();
renderer.renderMode = ParticleSystemRenderMode.Mesh;
renderer.mesh = CreateCrystalMesh();
renderer.material = CreateParticleMaterial();
particles.Play();
return effect;
}
// 创建低模菱形水晶碎片 Mesh。
private Mesh CreateCrystalMesh()
{
Mesh mesh = new Mesh { name = "DeathCrystal" };
mesh.vertices = new[]
{
new Vector3(0f, 0.5f, 0f), new Vector3(0.5f, 0f, 0f),
new Vector3(0f, 0f, 0.5f), new Vector3(-0.5f, 0f, 0f),
new Vector3(0f, 0f, -0.5f), new Vector3(0f, -0.5f, 0f)
};
mesh.triangles = new[]
{
0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 1,
5, 2, 1, 5, 3, 2, 5, 4, 3, 5, 1, 4
};
mesh.RecalculateNormals();
mesh.RecalculateBounds();
return mesh;
}
// 创建带浅蓝发光效果的水晶材质。
private Material CreateParticleMaterial()
{
Shader shader = Shader.Find("Standard");
Material material = new Material(shader);
material.color = deathEffectColor;
material.SetFloat("_Metallic", 0.15f);
material.SetFloat("_Glossiness", 0.85f);
material.SetColor("_EmissionColor", deathEffectColor * 1.6f);
material.EnableKeyword("_EMISSION");
return material;
}
// 根据单位模型或碰撞体计算血条位置和宽度。
private void CalculateLayout()
{
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: XHMY4H75Wy3Cr/RPdXPJU1a9sQY5AxIv97RPbSFNocYRrL6otbbgIhA=
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,147 +0,0 @@
fileFormatVersion: 2
guid: XnwftHuvU3qxc0EeEMqBKf7qMukgL6uRKB6EkZT0b0buvwQwEBTWHNk=
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
webStreaming: 0
priorityLevel: 0
uploadedMode: 2
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 1
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -1,147 +0,0 @@
fileFormatVersion: 2
guid: CS8Z5iL/B3imQJEz/ZUyiGEZC5CSHj6Vp+eVsHEQcbdjbUvEOSfyAII=
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
webStreaming: 0
priorityLevel: 0
uploadedMode: 2
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 KiB

@@ -1,147 +0,0 @@
fileFormatVersion: 2
guid: XCwasSmvVS4r5pAO0NmnA7uTIr8CczzjO6SJLLUqGQy+gIUKJscAiGU=
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
webStreaming: 0
priorityLevel: 0
uploadedMode: 2
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant: