Skip to content

Instantly share code, notes, and snippets.

@TSUMIKISEISAKU
Last active September 27, 2023 01:34
Show Gist options
  • Save TSUMIKISEISAKU/7aa9c2923a9c40851bd3112c300160db to your computer and use it in GitHub Desktop.
Save TSUMIKISEISAKU/7aa9c2923a9c40851bd3112c300160db to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// マーキングの入力の取得 デモ用
/// </summary>
public class MarkingInputHandler_Demo : MonoBehaviour
{
[SerializeField, Tooltip("マーキング制御")]
private MarkingHandler _markingHandler;
[SerializeField, Tooltip("マーキング位置のガイド")]
private Transform _markingPosition;
[SerializeField, Tooltip("スプレーのエフェクトの制御")]
private SprayEffectHandler _sprayEffectHandler;
[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.LeftTriggerDown())
{
_sprayEffectHandler.Play();
}
if (_controllerInputHandler.LeftTriggerHold())
{
_markingHandler.PaintTest(_markingPosition.position, _markingPosition.forward);
}
if (_controllerInputHandler.LeftTriggerUp())
{
_sprayEffectHandler.Stop();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment