コーン状態で吹っ飛び条件分け
This commit is contained in:
parent
25aeecbb32
commit
045621a077
|
|
@ -142,16 +142,20 @@ public class Corn : MonoBehaviour
|
|||
// フライパンに追従しないようにparent解除
|
||||
transform.parent = null;
|
||||
|
||||
Observable.Timer(TimeSpan.FromSeconds(Random.Range(.5f, .9f))).Subscribe(_ =>
|
||||
switch (prevCondition)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
switch (prevCondition)
|
||||
{
|
||||
case CornCondition.Seed:
|
||||
VibrationManager.Instance.PlayVibrationOnce();
|
||||
break;
|
||||
case CornCondition.Simple:
|
||||
case CornCondition.Burnt:
|
||||
case CornCondition.Seed:
|
||||
VibrationManager.Instance.PlayVibrationOnce();
|
||||
Observable.Timer(TimeSpan.FromSeconds(.5f)).Subscribe(_ =>
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}).AddTo(this);
|
||||
break;
|
||||
case CornCondition.Simple:
|
||||
case CornCondition.Burnt:
|
||||
Observable.Timer(TimeSpan.FromSeconds(Random.Range(.3f, .5f))).Subscribe(_ =>
|
||||
{
|
||||
Destroy(gameObject);
|
||||
// 画面KO再生(同時飛び出し時ランダム)
|
||||
var animation = Instantiate(spilledCornAnimationPrefab, new Vector2(Random.value * worldWidth * 2 - worldWidth, Random.value * 2 * 2 - 2), Quaternion.identity);
|
||||
VibrationManager.Instance.PlayVibrationOnce();
|
||||
|
|
@ -159,13 +163,15 @@ public class Corn : MonoBehaviour
|
|||
{
|
||||
Destroy(animation);
|
||||
});
|
||||
break;
|
||||
case CornCondition.Spilled:
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(prevCondition), prevCondition, null);
|
||||
}
|
||||
}).AddTo(this);
|
||||
}).AddTo(this);
|
||||
|
||||
break;
|
||||
case CornCondition.Spilled:
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(prevCondition), prevCondition, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SetCornProperty(float popTime, float burntDuration, float spillSpeed, float popSpeed)
|
||||
|
|
|
|||
Loading…
Reference in New Issue