画面KO演出を出す確率を調整可能にした
This commit is contained in:
parent
3a3b3c3336
commit
be1c168238
|
|
@ -8924,6 +8924,8 @@ MonoBehaviour:
|
|||
cornBurntRandom: 5
|
||||
cornSpillSpeed: 160
|
||||
cornPopSpeed: 30
|
||||
screenKoProbability: 0.055
|
||||
maxScreenKoCount: 2
|
||||
cornCountSlider: {fileID: 657773260}
|
||||
faildCountSlider: {fileID: 657773259}
|
||||
coldGrowSpeedSlider: {fileID: 1661453984}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ public class CornManager : MonoBehaviour
|
|||
[SerializeField] private float cornBurntRandom = 1f;
|
||||
[SerializeField] private float cornSpillSpeed = 50f;
|
||||
[SerializeField] private float cornPopSpeed = 20f;
|
||||
[Space]
|
||||
[SerializeField, Range(0,1)] private float screenKoProbability;
|
||||
[SerializeField] private int maxScreenKoCount;
|
||||
|
||||
public IReadOnlyReactiveProperty<CornResult> Result => result;
|
||||
private readonly ReactiveProperty<CornResult> result = new ReactiveProperty<CornResult>();
|
||||
|
|
@ -42,6 +45,7 @@ public class CornManager : MonoBehaviour
|
|||
private readonly CompositeDisposable compositeDisposable = new CompositeDisposable();
|
||||
|
||||
#if DEVELOPMENT_BUILD || UNITY_EDITOR
|
||||
[Space]
|
||||
[SerializeField] private Slider cornCountSlider;
|
||||
[SerializeField] private Slider faildCountSlider;
|
||||
[SerializeField] private Slider coldGrowSpeedSlider;
|
||||
|
|
@ -67,10 +71,11 @@ public class CornManager : MonoBehaviour
|
|||
// 5フレームごとに2回など演出の回数を制御
|
||||
cornSpilledSubject
|
||||
.Where(x => x.cond != CornCondition.Seed) // Seedは演出なし
|
||||
.Where(_ => Random.value < screenKoProbability) // 演出を出す確率
|
||||
.BatchFrame(5, FrameCountType.EndOfFrame) // 指定フレーム分まとめる
|
||||
.Subscribe(x =>
|
||||
{
|
||||
foreach (var item in x.RandomChoose(2))
|
||||
foreach (var item in x.RandomChoose(maxScreenKoCount))
|
||||
{
|
||||
SpawnSpilledAnimation(item.cond, item.pos);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue