IsRunning
How do I use Is Running
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
25 | UpdateIsRunning(); | 1 |
89 | void UpdateIsRunning() | 2 |
33 | isRunning = true; | 3 |
108 | if (isRunning) | 4 |
68 | isRunning = true; | 5 |
217 | if (isRunning) | 6 |
446 | public void setRunning(bool isRunning) | 7 |
92 | public void setRunning(bool isRunning) | 8 |
31 | public void setRuning(bool isRunning) | 9 |
23 | isRunning = true; | 10 |
File name: JumpAndRunMovement.cs
Copy
22 void Update()
23 {
24 UpdateIsGrounded();
25 UpdateIsRunning();
26 UpdateFacingDirection();
27 }
File name: JumpAndRunMovement.cs
Copy
89 void UpdateIsRunning()
90 {
91 m_Animator.SetBool( "IsRunning", Mathf.Abs( m_Body.velocity.x ) > 0.1f );
92 }
File name: Combo.cs
Copy
31 public void Start()
32 {
33 isRunning = true;
34 totalTime = 5;
35 texts = new string[] { "a", "s", "d", "f", "g", "h", "j", "k", "" };
36 this.comboIndex = -1;
37 this.comboType = ComboType.NONE;
38 this.pl = label.transform.localPosition;
39 gameObject.SetActive(false);
40 }
File name: Combo.cs
Copy
106 public void Update()
107 {
108 if (isRunning)
109 {
110 if (isUpdateTask)
111 {
112 stateTime -= Time.deltaTime;
113
114 if (stateTime <= 0)
115 {
116 stateTime = 0;
117 SetVisible(false);
118 comboIndex = -1;
119 comboType = ComboType.NONE;
120 numberCombo = 0;
121 isUpdateTask = false;
122 }
123 task.transform.localScale = new Vector3(stateTime / totalTime, 1, task.transform.localScale.z);
124 }
125 }
126 }
File name: Animal.cs
Copy
52 void Start()
53 {
54 CircleCollider2D animalCollider = gameObject.AddComponent
55 animalCollider.radius = 0.3f;
56 animalCollider.offset = new Vector2(0, 0.27f);
57 animalCollider.sharedMaterial = Resources.Load
58 animalBody = gameObject.AddComponent
59 //animalBody.fixedAngle = true;
60 animalBody.constraints = RigidbodyConstraints2D.FreezeRotation;
61 state = JUMPING;
62 //gameObject.name = "Animal";
63
64 //test
65 //if (animalIndex != 0) gameObject.SetActive(false);
66
67 stepJump = 2;
68 isRunning = true;
69 }
File name: Animal.cs
Copy
215 public void Update()
216 {
217 if (isRunning)
218 {
219 if (isStanding)
220 {
221 standTime -= Time.deltaTime;
222 if (standTime <= 0)
223 {
224 isStanding = false;
225 setStand(false, 0, STATE_RUN);
226 }
227 }
228 else if (IsSpeedUp)
229 {
230 SpeedUpTime -= Time.deltaTime;
231 if (!IsSpeedUpStart)
232 {
233 if (transform.localPosition.y <= 1f)
234 animalBody.velocity = new Vector2(4, 5);
235 else
236 IsSpeedUpStart = true;
237 }
238 else
239 animalBody.velocity = new Vector2(12, 0);
240
241 if (SpeedUpTime <= 0)
242 {
243 IsSpeedUp = false;
244 }
245 }
246 else
247 {
248 UpdateAnimal();
249 }
250
251 if (IsProtected)
252 {
253 ProtectedTime -= Time.deltaTime;
254 if (ProtectedTime <= 0)
255 IsProtected = false;
256 }
257
258 }
259 }
File name: Animal.cs
Copy
446 public void setRunning(bool isRunning)
447 {
448 this.isRunning = isRunning;
449 gameObject.GetComponent
450 gameObject.GetComponent
451 }
File name: Animals.cs
Copy
92 public void setRunning(bool isRunning)
93 {
94 for (int i = 0; i < animals.Count; i++)
95 {
96 animals[i].GetComponent
97 }
98 }
File name: Background.cs
Copy
31 public void setRuning(bool isRunning)
32 {
33 bg0.GetComponent
34 bg1.GetComponent
35 bg2.GetComponent
36 }
File name: BG.cs
Copy
20 public void Start()
21 {
22 speed = new Vector3(speedX, 0, 0);
23 isRunning = true;
24 }
IsRunning 123 lượt xem
Gõ tìm kiếm nhanh...