public static NetcodeConversionTarget GetConversionTarget(GameObjectConversionSystem system)
        {
            // Detect target using build settings (This is used from sub scenes)
#if UNITY_EDITOR
            {
                var settings = system.GetBuildSettingsComponent <NetCodeConversionSettings>();
                if (settings != null)
                {
                    //Debug.LogWarning("BuildSettings conversion for: " + settings.Target);
                    return(settings.Target);
                }
            }
#endif

            if (system.DstEntityManager.World.GetExistingSystem <ClientSimulationSystemGroup>() != null)
            {
                return(NetcodeConversionTarget.Client);
            }
            if (system.DstEntityManager.World.GetExistingSystem <ServerSimulationSystemGroup>() != null)
            {
                return(NetcodeConversionTarget.Server);
            }

            return(NetcodeConversionTarget.Undefined);
        }
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        GameDebug.Log(string.Format("Convert DotsAnimStateController:{0}", this));

        var settings = AnimSourceController.Settings.Default;

        settings.RootAnimSource = AnimSourceRoot;
        dstManager.AddComponentData(entity, settings);

        var rigDataBuffer = dstManager.AddBuffer <AnimSourceController.RigData>(entity);

        for (int i = 0; i < Rigs.Count; i++)
        {
            var rigData = new AnimSourceController.RigData
            {
                Rig     = RigDefinitionAsset.ConvertRig(Rigs[i].Rig),
                MaxDist = Rigs[i].MaxDist,
            };
            rigDataBuffer.Add(rigData);
        }

        var conversionSettings = conversionSystem.GetBuildSettingsComponent <NetCodeConversionSettings>();
        var server             = conversionSettings != null ? conversionSettings.Target == NetcodeConversionTarget.Server :
                                 dstManager.World.GetExistingSystem <Unity.NetCode.ServerSimulationSystemGroup>() != null;
        var color = server ? Color.gray : Color.green;

        dstManager.AddComponentData(entity, new SkeletonRenderer {
            Color = color,
        });
    }
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        var rotationSpeedSetting = conversionSystem.GetBuildSettingsComponent <RotationSpeedSetting>();

        // Change rotation speed
        var data = new RotationSpeed_IJobChunk {
            RadiansPerSecond = math.radians(rotationSpeedSetting.RotationSpeed)
        };

        dstManager.AddComponentData(entity, data);

        // Offset the translation of the generated object
        var translation = dstManager.GetComponentData <Translation>(entity);

        translation.Value.y += rotationSpeedSetting.Offset;
        dstManager.SetComponentData(entity, translation);
    }