Пример #1
0
 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);
     }
 }
Пример #2
0
        public void Setting_off_frozen_instance_property_throws()
        {
            var data = CreateData();

            Freezer.Freeze(data);
            data.Id = 45;
        }
Пример #3
0
        public void Can_freeze_instance()
        {
            var data = CreateData();

            Freezer.Freeze(data);
            Assert.IsTrue(Freezer.IsFrozen(data));
        }
Пример #4
0
        public void Can_read_frozen_property()
        {
            var data = CreateData();

            Freezer.Freeze(data);
            var id = data.Id;
        }
Пример #5
0
 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();
     }
 }
Пример #6
0
 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);
     }
 }
Пример #7
0
        public void Freeze_throws_on_non_freezable()
        {
            var data = new Data()
            {
                Id = 42, Name = "Everything"
            };

            Freezer.Freeze(data);
        }
Пример #8
0
        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);
        }
Пример #9
0
        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);
        }
Пример #10
0
        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"
            };
        }
Пример #11
0
        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));
        }
Пример #12
0
        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());
        }
Пример #13
0
 public static void PauseFlow()
 {
     // Pause Flow
     if (state != FlowState.Started)
     {
         return;
     }
     Freezer.Freeze();
     state = FlowState.Paused;
 }
Пример #14
0
        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));
        }
Пример #15
0
    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());
        }
    }
Пример #16
0
        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");
        }
Пример #17
0
        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);
        }
Пример #18
0
        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);
        }
Пример #19
0
        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;
        }
Пример #20
0
        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
            });
        }
Пример #21
0
        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");
        }
Пример #22
0
 private void die()
 {
     cameraAnim.SetTrigger(playerDead);
     _freezer.Freeze(deathFreezeTime, deathTimeScale);
     //Destroy(gameObject);
 }
Пример #23
0
        private void Freeze_Click(object sender, RoutedEventArgs e)
        {
            Freezer freezer = new Freezer();

            freezer.Freeze((Button)e.Source, this);
        }
Пример #24
0
 public void FreezeFrame()
 {
     frameFreezer.Freeze();
 }
Пример #25
0
 void freeze()
 {
     freezer.Freeze();
 }