Example #1
0
            public void Execute([ReadOnly] ref ShipPowers shipPowers, ref ActorAttribute3 <_Power> power, [ReadOnly, ChangedFilter] ref ActorAttribute1 <_PowerLevel> powerLevel)
            {
                var level     = (int)powerLevel.value;
                var powerInfo = shipPowers.get(level);

                power.max    = powerInfo.max;
                power.regain = powerInfo.regain;
            }
Example #2
0
            public void Execute(Entity shipEntity, int index,
                                [ReadOnly] ref ActorAttribute3 <_Power> power,
                                [ReadOnly] ref ShipPowers shipPowers, [ReadOnly] ref Translation translation)
            {
                if (power.value <= 0f)
                {
                    var lostInputTime = shipPowers.lostInputTime + math.abs(power.value) * shipPowers.power2Time;

                    endCommandBuffer.AddComponent(index, shipEntity, new ShipLostInputState {
                        time = shipPowers.lostInputTime = lostInputTime
                    });
                    endCommandBuffer.SetComponent(index, shipEntity, new ShipMoveInput {
                        lost = true
                    });

                    ShipLostInputFxSpawner.createInServer(endCommandBuffer, index, shipEntity, translation, lostInputTime);
                }
            }