1
This commit is contained in:
1 parent
fb353c45a7
commit
84d0a510bb
46 files changed
+9866
-94
No files matched your search
@@ -5,7 +5,7 @@ public class StatusEffectController : MonoBehaviour
|
||||
[Header("通用眩晕显示")]
|
||||
[SerializeField] private bool showStunIndicator = true;
|
||||
[SerializeField] private float indicatorHeight = 0.35f;
|
||||
[SerializeField] private float indicatorSize = 0.5f;
|
||||
[SerializeField] private GameObject stunIndicatorPrefab;
|
||||
|
||||
private Animator animator;
|
||||
private float stunnedRemaining;
|
||||
@@ -92,34 +92,18 @@ public class StatusEffectController : MonoBehaviour
|
||||
bounds.max.y + indicatorHeight,
|
||||
bounds.center.z);
|
||||
|
||||
Camera camera = Camera.main;
|
||||
if (camera != null)
|
||||
{
|
||||
indicatorTransform.rotation = Quaternion.LookRotation(
|
||||
camera.transform.position - indicatorTransform.position,
|
||||
camera.transform.up)
|
||||
* Quaternion.Euler(0f, 0f, Time.unscaledTime * 180f);
|
||||
}
|
||||
}
|
||||
|
||||
private void EnsureIndicator()
|
||||
{
|
||||
if (stunIndicator != null)
|
||||
if (stunIndicator != null || stunIndicatorPrefab == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
stunIndicator = new GameObject("StunIndicator_Star");
|
||||
stunIndicator = Instantiate(stunIndicatorPrefab);
|
||||
stunIndicator.name = "StunIndicator_Particle";
|
||||
indicatorTransform = stunIndicator.transform;
|
||||
|
||||
TextMesh text = stunIndicator.AddComponent<TextMesh>();
|
||||
text.text = "★";
|
||||
text.anchor = TextAnchor.MiddleCenter;
|
||||
text.alignment = TextAlignment.Center;
|
||||
text.fontSize = 64;
|
||||
text.characterSize = indicatorSize;
|
||||
text.fontStyle = FontStyle.Bold;
|
||||
text.color = new Color(1f, 0.85f, 0.05f, 1f);
|
||||
}
|
||||
|
||||
private void DestroyIndicator()
|
||||
|
||||
Reference in new issue
Block a user