-
-
Save TSUMIKISEISAKU/1e8ad7f9d10ab01633437bef1d284b9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
/// <summary> | |
/// コンクリート破砕デモ用入力取得 | |
/// </summary> | |
public class ConcreteBreakTrigger_Demo : MonoBehaviour | |
{ | |
[SerializeField, Tooltip("コンクリートへのダメージ適用(オプション)")] | |
private DamageApplier _damageApplier; | |
[SerializeField, Tooltip("破片のパーティクルの制御")] | |
private ConcreteParticlesHandler _particleHandler; | |
[SerializeField, Tooltip("効果音")] | |
private AudioSource _sfxSource; | |
[SerializeField, Tooltip("コントローラーの入力取得")] | |
private ControllerInputHandler _controllerInputHandler; | |
// Start is called before the first frame update | |
void Start() | |
{ | |
} | |
// Update is called once per frame | |
void Update() | |
{ | |
if (_controllerInputHandler.RightTriggerDown()) | |
{ | |
_sfxSource.Play(); | |
} | |
else if (_controllerInputHandler.RightTriggerUp()) | |
{ | |
_sfxSource.Stop(); | |
_particleHandler.Stop(); | |
} | |
if (_controllerInputHandler.RightTriggerHold()) | |
{ | |
_controllerInputHandler.VibrateRightController(); | |
_controllerInputHandler.VibrateLeftController(); | |
_damageApplier?.ApplyDamage(true); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment