ゴール時アニメーション実装
This commit is contained in:
parent
2d0a1f7bf3
commit
d0e54175e5
|
|
@ -318,7 +318,7 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
||||||
break;
|
break;
|
||||||
case GameState.Success:
|
case GameState.Success:
|
||||||
SoundManager.Instance.PlaySE("se_minigame_End");
|
SoundManager.Instance.PlaySE("se_minigame_End");
|
||||||
player.Stay();
|
player.Result();
|
||||||
this.CallWaitForSeconds(1f, () =>
|
this.CallWaitForSeconds(1f, () =>
|
||||||
{
|
{
|
||||||
resultManager.ShowResult(scoreCount.Value, placeList, stageData);
|
resultManager.ShowResult(scoreCount.Value, placeList, stageData);
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
||||||
[SerializeField] private GameObject level3;
|
[SerializeField] private GameObject level3;
|
||||||
private Animator animator;
|
private Animator animator;
|
||||||
private bool isJump;
|
private bool isJump;
|
||||||
|
private bool isResult;
|
||||||
private bool isHit;
|
private bool isHit;
|
||||||
public bool IsHit => isHit;
|
public bool IsHit => isHit;
|
||||||
private readonly BoolReactiveProperty isHitStay = new BoolReactiveProperty();
|
private readonly BoolReactiveProperty isHitStay = new BoolReactiveProperty();
|
||||||
|
|
@ -78,6 +79,10 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
||||||
}, () =>
|
}, () =>
|
||||||
{
|
{
|
||||||
isJump = false;
|
isJump = false;
|
||||||
|
if (isResult)
|
||||||
|
{
|
||||||
|
Result();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -111,12 +116,30 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
||||||
{
|
{
|
||||||
isHit = false;
|
isHit = false;
|
||||||
isHitStay.Value = false;
|
isHitStay.Value = false;
|
||||||
Stay();
|
if (isResult)
|
||||||
|
{
|
||||||
|
Result();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Stay();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Result()
|
||||||
|
{
|
||||||
|
if (isJump || isHit)
|
||||||
|
{
|
||||||
|
isResult = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
isResult = false;
|
||||||
|
animator?.Play("Brother_pink_glad");
|
||||||
|
}
|
||||||
|
|
||||||
public void AddCount()
|
public void AddCount()
|
||||||
{
|
{
|
||||||
SoundManager.Instance.PlaySE("se_minigame_ItemGet");
|
SoundManager.Instance.PlaySE("se_minigame_ItemGet");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue