ボタンを押している間はプレイヤーを右に移動するスクリプトを書きました。
しかし、Pointer DownのNo Functionの欄にPushDownを入れたいのですがPushDownがありません。
ご教授願います。
↓ボタンにアタッチしているスクリプト
C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4 5public class RightButton : MonoBehaviour { 6 public float speed = 3; 7 bool push = false; 8 9 public void Update(){ 10 if(push){ 11 Move(); 12 } 13 } 14 15 public void PushDown(){ 16 push = true; 17 } 18 19 public void PushUp(){ 20 push = false; 21 } 22 23 public void Move(){ 24 Vector2 direction = new Vector2 (1.0f, 0).normalized; 25 GetComponent<Rigidbody2D>().velocity = direction * speed; 26 } 27} 28
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/07/10 13:48
2018/07/10 14:00
退会済みユーザー
2018/07/11 06:36