private void SetCanBeIgnited(bool canBeIgnited)
 {
     if (flammable.Data.CanBeIgnited != canBeIgnited)
     {
         var update = new Flammable.Update()
         {
             CanBeIgnited = canBeIgnited
         };
         flammable.SendUpdate(update);
     }
 }
示例#2
0
        public override void Enter()
        {
            var update = new Flammable.Update()
            {
                CanBeIgnited = false
            };

            flammable.SendUpdate(update);

            flammable.OnUpdate += (OnFlammableUpdated);
            health.OnUpdate    += (OnHealthUpdated);
        }
示例#3
0
        public override void Enter()
        {
            var update = new Flammable.Update()
            {
                CanBeIgnited = false
            };

            flammable.SendUpdate(update);

            if (regrowingCoroutine == null)
            {
                regrowingCoroutine = parentBehaviour.StartCoroutine(TimerUtils.WaitAndPerform(SimulationSettings.TreeStumpRegrowthTimeSecs, Regrow));
            }
        }
示例#4
0
        public override void Enter()
        {
            // 进入这个状态的时候,要把树的血设置满
            var update = new Health.Update
            {
                CurrentHealth = SimulationSettings.TreeMaxHealth
            };

            health.SendUpdate(update);
            var update2 = new Flammable.Update
            {
                CanBeIgnited = true
            };

            flammable.SendUpdate(update2);

            flammable.OnUpdate += (OnFlammableUpdated);
            health.OnUpdate    += (OnHealthUpdated);
        }