add:添加漂流瓶破碎动画,init里添加调试开关
This commit is contained in:
@@ -52,6 +52,8 @@ public class GameInit : MonoBehaviour
|
||||
public GamePlace gamePlace;
|
||||
|
||||
public GameKey gameId;
|
||||
|
||||
public bool debugMode;
|
||||
|
||||
[NonSerialized]
|
||||
public Player self;
|
||||
|
||||
@@ -144,10 +144,13 @@ public class DriftBottle : MonoBehaviour
|
||||
// 注销
|
||||
SafeUnregister();
|
||||
|
||||
// 触发捕获事件
|
||||
OnBottleCaptured?.Invoke(this, fragmentIndex, statueIndex);
|
||||
DriftBottleManager.Instance?.OnBottleCaptured(this, fragmentIndex, statueIndex);
|
||||
CoroutineTaskManager.Instance.WaitSecondTodo(() =>
|
||||
{
|
||||
DriftBottleManager.Instance?.OnBottleCaptured(this, fragmentIndex, statueIndex);
|
||||
}, 2f);
|
||||
|
||||
// 触发捕获事件
|
||||
//OnBottleCaptured?.Invoke(this, fragmentIndex, statueIndex);
|
||||
// 播放特效
|
||||
PlayCaptureEffects();
|
||||
}
|
||||
@@ -157,10 +160,11 @@ public class DriftBottle : MonoBehaviour
|
||||
/// </summary>
|
||||
private void PlayCaptureEffects()
|
||||
{
|
||||
fragmentEffect.gameObject.SetActive(false);
|
||||
// 碎片特效
|
||||
if (fragmentEffect != null)
|
||||
fragmentEffect.Play();
|
||||
|
||||
var x = modelRoot.GetComponent<Animator>();
|
||||
if(x != null)
|
||||
x.SetBool("isDie",true);
|
||||
// 播放音效
|
||||
GameManager.Ins?.PlaySound3D("漂流瓶击碎", transform);
|
||||
|
||||
@@ -168,7 +172,7 @@ public class DriftBottle : MonoBehaviour
|
||||
CoroutineTaskManager.Instance.WaitSecondTodo(() =>
|
||||
{
|
||||
RemoveInternal();
|
||||
}, 1f);
|
||||
}, 2.5f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -157,9 +157,15 @@ public class LoginPanel : MonoBehaviour
|
||||
CoroutineTaskManager.Instance.WaitSecondTodo(() =>
|
||||
{
|
||||
//GameManager.Ins.CreateGameStartPoint();
|
||||
GameManager.Ins.CreateAICharacter();
|
||||
if (GameInit.Ins.debugMode)
|
||||
{
|
||||
GameManager.Ins.CreateGameStartPoint();
|
||||
}
|
||||
else
|
||||
{
|
||||
GameManager.Ins.CreateAICharacter();
|
||||
}
|
||||
}, 1);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user