void hit() { // hitbool = true; life = life - 1; SetLifeText(); hitbool = true; if (life > 0) { audioSrc.PlayOneShot(splatSound); Debug.Log("Youve been hit!"); _freezer.Freeze(); //SceneManager.LoadScene(SceneManager.GetActiveScene().name); // this.gameObject.GetComponent<SpriteRenderer>().sprite = frog; //hitbool = false; } if (life == 0) { audioSrc.PlayOneShot(splatSound); this.gameObject.GetComponent <SpriteRenderer>().sprite = splash; _freezer.Freeze(); audioSrc.PlayOneShot(trombone); Debug.Log("You loose!"); Destroy(this); } }
public void Setting_off_frozen_instance_property_throws() { var data = CreateData(); Freezer.Freeze(data); data.Id = 45; }
public void Can_freeze_instance() { var data = CreateData(); Freezer.Freeze(data); Assert.IsTrue(Freezer.IsFrozen(data)); }
public void Can_read_frozen_property() { var data = CreateData(); Freezer.Freeze(data); var id = data.Id; }
void OnTriggerEnter2D(Collider2D col) { if (col.tag == "car" && !isDead) { isDead = true; hit(); } if (col.tag == "water" && !isDead) { isDead = true; drown(); } if (col.tag == "bird" && !isDead) { isDead = true; eaten(); } if (col.tag == "level") { string levelT = frogMove.levelPoint(col.name); levelText.writeText(levelT, 2); if (levelT != "") { _freezer.Freeze(); } } if (col.tag == "turtle" && !isDead) { GameObject other = col.gameObject; if (other.GetComponent <turtle>().isDown() == true && !isDead) { isDead = true; drown(); } } if (col.tag == "coin") { Destroy(col.gameObject); coin_counter.add(); } if (col.tag == "camel" && !isDead) { isDead = true; hit(); } }
public void takeDamage(float damage) { currentHealth = currentHealth - damage; healthBar.fillAmount = currentHealth / turretHealth; //_freezer.Freeze(damageFreezeTime, hitTimeScale); anim.SetTrigger(damaged); if (currentHealth <= 0) { //No funciona bien el freeze junto con el cameraShake cameraShake.ShakeCamera(cameraShakeTime, cameraShakeMag); _freezer.Freeze(killFreezeTime, killTimeScale); destroyEnemy(); } else { _freezer.Freeze(damageFreezeTime, hitTimeScale); } }
public void Freeze_throws_on_non_freezable() { var data = new Data() { Id = 42, Name = "Everything" }; Freezer.Freeze(data); }
public void Frozen_DtoWithValueCollection_throws_on_remove() { var dto = Freezer.AsFreezable(new DtoWithValueCollection() { Values = new List <int>(new[] { 1, 2, 3 }) }); Freezer.Freeze(dto); dto.Values.Remove(2); }
public void Frozen_DtoWithValueList_throws_on_remove() { var dto = Freezer.AsFreezable(new DtoWithValueList() { Values = new[] { 1, 2, 3 } }); Freezer.Freeze(dto); dto.Values.Remove(2); }
public void Freezing_datagraph_causes_throw_on_setting_of_settable_child() { var data = CreateData(); Freezer.Freeze(data); data.Settable = new DataChild() { Id = 123, Name = "foo" }; }
public void FreezeDry_on_frozen_instance_is_noop() { var data = CreateData(); Freezer.Freeze(data); var data2 = Freezer.FreezeDry(data); Assert.AreSame(data, data2); Assert.IsTrue(Freezer.IsFrozen(data2)); }
public void Can_freeze_and_access_DtoWithValueEnumerable() { var dto = Freezer.AsFreezable(new DtoWithValueEnumerable() { Values = new[] { 1, 2, 3 } }); Freezer.Freeze(dto); Assert.AreEqual(1, dto.Values.First()); }
public static void PauseFlow() { // Pause Flow if (state != FlowState.Started) { return; } Freezer.Freeze(); state = FlowState.Paused; }
public void Thaw_on_frozen_returns_new_unfrozen_instance() { var data = CreateData(); Freezer.Freeze(data); var data2 = Freezer.Thaw(data); Assert.AreNotSame(data, data2); AssertSameValue(data, data2); Assert.IsFalse(Freezer.IsFrozen(data2)); }
void Update() { if (AI_Script.Health <= 0 && !firstPass) { //freeze the screen freeze_Script.Freeze(); //so we want this to work, and it does, but it breaks the reset //set variable to true matchOver = true; StartCoroutine(waiter()); } }
public void Freezing_datagraph_causes_throw_on_child_set_of_readonly_child() { var data = CreateData(); Freezer.Freeze(data); var child = data.Readonly; try { child.Id = 123; } catch (FrozenAccessException) { return; } Assert.Fail("shouldn't have been able to set child property"); }
public void Can_freeze_and_access_DtoWithObjectList() { var dto = Freezer.AsFreezable(new DtoWithObjectList() { Id = 1, Children = new[] { new DtoWithObjectList() { Id = 2, Children = new[] { new DtoWithObjectList() } } } }); Freezer.Freeze(dto); Assert.AreEqual(2, dto.Children[0].Id); }
public void Frozen_DtoWithObjectCollection_throws_on_remove() { var dto = Freezer.AsFreezable(new DtoWithObjectCollection() { Id = 1, Children = new[] { new DtoWithObjectCollection() { Id = 2, Children = new[] { new DtoWithObjectCollection() } } } }); Freezer.Freeze(dto); var c = dto.Children.First(); dto.Children.Remove(c); }
public void Frozen_DtoWithObjectEnumerable_throws_on_mod_item() { var dto = Freezer.AsFreezable(new DtoWithObjectEnumerable() { Id = 1, Children = new[] { new DtoWithObjectEnumerable() { Id = 2, Children = new[] { new DtoWithObjectEnumerable() } } } }); Freezer.Freeze(dto); var c = dto.Children.First(); c.Id = 5; }
public void Frozen_DtoWithObjectList_throws_on_add() { var dto = Freezer.AsFreezable(new DtoWithObjectList() { Id = 1, Children = new[] { new DtoWithObjectList() { Id = 2, Children = new[] { new DtoWithObjectList() } } } }); Freezer.Freeze(dto); dto.Children.Add(new DtoWithObjectList() { Id = 10 }); }
public void Freezing_datagraph_causes_throw_on_child_set_of_settable_child() { var data = CreateData(); data.Settable = new DataChild() { Id = 123, Name = "foo" }; Freezer.Freeze(data); var child = data.Settable; try { child.Id = 456; } catch (FrozenAccessException) { return; } Assert.Fail("shouldn't have been able to set child property"); }
private void die() { cameraAnim.SetTrigger(playerDead); _freezer.Freeze(deathFreezeTime, deathTimeScale); //Destroy(gameObject); }
private void Freeze_Click(object sender, RoutedEventArgs e) { Freezer freezer = new Freezer(); freezer.Freeze((Button)e.Source, this); }
public void FreezeFrame() { frameFreezer.Freeze(); }
void freeze() { freezer.Freeze(); }