增加特效 ,优化道具外观

This commit is contained in:
2024-10-27 17:14:19 +08:00
parent daeaa8487a
commit e6616c90d5
6 changed files with 24513 additions and 10 deletions

View File

@@ -1,7 +1,9 @@
using System;
using Framework.GamePool.manager;
using Framework.Timer;
using Framework.Utils.Extend;
using Game.EventDefine;
using Sirenix.Utilities;
using UnityEngine;
namespace Game.Component
@@ -10,9 +12,11 @@ namespace Game.Component
{
public float speed = 10;
public Rigidbody2D rigidbody2D;
public string deadEffect;
private float speedBuffOffset;
private TimeHandler speedBuffTimer;
public float CurSpeed => MapContent.Instance.MoveGlobalOffset * this.speed *
(1 + (this.speedBuffTimer?.IsPlaying ?? false ? this.speedBuffOffset * (1 - this.speedBuffTimer.CurProgress) : 0));
@@ -63,6 +67,13 @@ namespace Game.Component
{
if (other.CompareTag ("Enemy"))
{
if (!this.deadEffect.IsNullOrWhitespace ())
{
this.gameObject.SetActive (false);
var transform1 = this.transform;
GamePoolManager.Instance.InstantiatePoolObject<PropEffect_PoolObject> (this.deadEffect).transform.position
= transform1.position;
}
//死亡特效
GameEventDefine.ChangeGameFsm.SendMessage (GameState.FieldGame);
}