Beispiel #1
0
        private static VelocityMultiplier CreateTimerAndGetVelocityMultiplier(
            ref EntityCommandBuffer commandBuffer, Entity target, float slowdownValue)
        {
            Entity timerEntity = commandBuffer.CreateEntity();

            commandBuffer.AddComponent <SlowdownDurationTimer>(timerEntity);
            commandBuffer.AddComponent(timerEntity, new Timer
            {
                AutoRestart = false,
                CurrentTime = 5,
                InitialTime = 5,
                Owner       = target
            });
            commandBuffer.AddComponent <Enabled>(timerEntity);

            var multiplier = new VelocityMultiplier
            {
                Value  = slowdownValue,
                Source = timerEntity
            };

            return(multiplier);
        }
 public void SetUp()
 {
     containingObject = new GameObject();
     subject          = containingObject.AddComponent <VelocityMultiplier>();
 }