private void Idle() { if (--idleCount <= 0) { mState = BerryState.Walking; UpdateState(); } }
private void Wahhh() { springController.ExtendSpring(); AudioSource.PlayClipAtPoint(audio.clip, new Vector3(0, 0, 0)); gameObject.rigidbody2D.fixedAngle = false; gameObject.rigidbody2D.velocity = new Vector2(-22, 0); mState = BerryState.End; }
private void Throwing() { if (throwingCount-- <= 0) { throwingCount = ThrowingCount; mState = BerryState.Throw; UpdateState(); } }
private void Walking() { rigidbody2D.velocity = new Vector2(-walkSpeed, 0); if (rigidbody2D.position.x < 9.6) { mState = BerryState.Throwing; UpdateState(); } }
private void Throw() { if (throwCount-- <= 0) { throwCount = ThrowCount; mState = BerryState.Throwing; UpdateState(); GameObject cat = (GameObject)Instantiate(kitty); cat.SetActive(true); cat.rigidbody2D.velocity = new Vector2(Random.Range(-25, 0), Random.Range(-1, 3)); } }
public void AddButton(int id) { if (!buttons.Contains(id)) { buttons.Add(id); } if (buttons.Count == 3) { mState = BerryState.Wahhh; UpdateState(); return; } Debug.Log(buttons.Count); }
public void AddButton(int id) { if(!buttons.Contains (id)) { buttons.Add (id); } if(buttons.Count == 3) { mState = BerryState.Wahhh; UpdateState(); return; } Debug.Log (buttons.Count); }
private void Idle() { if(--idleCount <= 0) { mState = BerryState.Walking; UpdateState (); } }
private void Walking() { rigidbody2D.velocity = new Vector2(-walkSpeed, 0); if(rigidbody2D.position.x < 9.6) { mState = BerryState.Throwing; UpdateState (); } }
private void Throwing() { if(throwingCount-- <= 0) { throwingCount = ThrowingCount; mState = BerryState.Throw; UpdateState (); } }
private void Throw() { if(throwCount-- <= 0) { throwCount = ThrowCount; mState = BerryState.Throwing; UpdateState(); GameObject cat = (GameObject)Instantiate (kitty); cat.SetActive(true); cat.rigidbody2D.velocity = new Vector2(Random.Range (-25, 0), Random.Range (-1, 3)); } }