質問編集履歴

2

Event Trigger(Script)の画像を変更

2018/06/04 08:07

投稿

Deckard
Deckard

スコア7

test CHANGED
File without changes
test CHANGED
@@ -94,9 +94,9 @@
94
94
 
95
95
 
96
96
 
97
- ![イメージ説明](0e36610a176f3589a3030f319ed57946.png)
98
97
 
99
98
 
99
+ ![イメージ説明](389105d931ed502669b4e9a51683d72f.png)
100
100
 
101
101
 
102
102
 

1

タイトルのとコードを修正

2018/06/04 08:07

投稿

Deckard
Deckard

スコア7

test CHANGED
@@ -1 +1 @@
1
- Mecanimのアニメーション遷移につ
1
+ Mecanimのアニメーションが変わらな
test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- UIンを続けてる間は、ロボットが走り続ける
5
+ Animatorでロットのアニメーションを変更い。
6
6
 
7
7
 
8
8
 
@@ -42,7 +42,7 @@
42
42
 
43
43
 
44
44
 
45
- ```C#
45
+ ```c#
46
46
 
47
47
  using System.Collections;
48
48
 
@@ -52,13 +52,11 @@
52
52
 
53
53
 
54
54
 
55
- public class RunAnimation : MonoBehaviour {
55
+ public class RunAnimation : MonoBehaviour
56
56
 
57
-
57
+ {
58
58
 
59
59
  private Animator animator;
60
-
61
- bool push = false;
62
60
 
63
61
 
64
62
 
@@ -68,65 +66,27 @@
68
66
 
69
67
  animator = GetComponent<Animator>();
70
68
 
69
+ }
70
+
71
+
72
+
73
+ public void ButtonRunDown()
74
+
75
+ {
76
+
71
- animator.SetBool("isRun", false);
77
+ animator.SetBool("isRun", true);
72
78
 
73
79
  }
74
80
 
75
81
 
76
82
 
77
- void Update()
83
+ public void ButtonRunUp()
78
84
 
79
85
  {
80
-
81
- if (push)
82
-
83
- {
84
-
85
- Move();
86
-
87
- }
88
-
89
- }
90
-
91
-
92
-
93
- //走り続ける
94
-
95
- public void Move()
96
-
97
- {
98
-
99
- animator.SetBool("isRun", true);
100
-
101
- }
102
-
103
-
104
-
105
- //UIボタンが押されたとき
106
-
107
- public void PushDown()
108
-
109
- {
110
-
111
- push = true;
112
-
113
- }
114
-
115
-
116
-
117
- //USボタンを離したとき
118
-
119
- public void PushUp()
120
-
121
- {
122
-
123
- push = false;
124
86
 
125
87
  animator.SetBool("isRun", false);
126
88
 
127
89
  }
128
-
129
-
130
90
 
131
91
  }
132
92