Hold Tilt
This commit is contained in:
@@ -30,6 +30,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
effectCollection.Add("Generate", new List<EffectBase>());
|
||||
effectCollection.Add("GeneralJudge", new List<EffectBase>());
|
||||
effectCollection.Add("StartHold", new List<EffectBase>());
|
||||
effectCollection.Add("Holding", new List<EffectBase>()); //仅用于Hold
|
||||
effectCollection.Add("Perfect", new List<EffectBase>());
|
||||
effectCollection.Add("Good", new List<EffectBase>());
|
||||
@@ -322,6 +323,15 @@ namespace Ichni.RhythmGame
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 如果效果被打断(主要对于Holding Effect),则触发这个方法
|
||||
/// </summary>
|
||||
public virtual void Disrupt()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 转换为存档类
|
||||
/// </summary>
|
||||
|
||||
8
Assets/Scripts/EditorGame/Base/Pool.meta
Normal file
8
Assets/Scripts/EditorGame/Base/Pool.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f85e090ad2708745a8fd3b9c254ad3a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
56
Assets/Scripts/EditorGame/Base/Pool/PooledObject.cs
Normal file
56
Assets/Scripts/EditorGame/Base/Pool/PooledObject.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace Ichni
|
||||
{
|
||||
public class PooledObject : MonoBehaviour, IPoolable
|
||||
{
|
||||
public UnityAction onSpawn;
|
||||
public UnityAction onDespawn;
|
||||
|
||||
public void OnSpawn()
|
||||
{
|
||||
onSpawn?.Invoke();
|
||||
}
|
||||
|
||||
public void OnDespawn()
|
||||
{
|
||||
onDespawn?.Invoke();
|
||||
}
|
||||
|
||||
public void SetOnSpawn(UnityAction action, bool isOverride = false, bool isAdditive = false)
|
||||
{
|
||||
if (isOverride)
|
||||
{
|
||||
onSpawn = action;
|
||||
}
|
||||
else if (isAdditive)
|
||||
{
|
||||
onSpawn += action;
|
||||
}
|
||||
else
|
||||
{
|
||||
onSpawn ??= action;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetOnDespawn(UnityAction action, bool isOverride = false, bool isAdditive = false)
|
||||
{
|
||||
if (isOverride)
|
||||
{
|
||||
onDespawn = action;
|
||||
}
|
||||
else if (isAdditive)
|
||||
{
|
||||
onDespawn += action;
|
||||
}
|
||||
else
|
||||
{
|
||||
onDespawn ??= action;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/EditorGame/Base/Pool/PooledObject.cs.meta
Normal file
11
Assets/Scripts/EditorGame/Base/Pool/PooledObject.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6ba0e915cddec743a29f85a93f12594
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user