Beispiel #1
0
    public ClientSettings(EntityManager manager)
    {
        var playerPrefab = Resources.Load("Prefabs/Ship") as GameObject;

        particleEmitter = playerPrefab.GetComponent <ParticleEmitterComponent>().Value;

        shipArchetype = manager.CreateArchetype(
            typeof(ShipTagComponentData),
            typeof(ShipStateComponentData),
            typeof(ParticleEmitterComponentData),
            typeof(CurrentSimulatedPosition),
            typeof(CurrentSimulatedRotation),
            typeof(Translation),
            typeof(Rotation));

        asteroidClientArchetype = manager.CreateArchetype(
            typeof(CurrentSimulatedPosition),
            typeof(CurrentSimulatedRotation),
            typeof(Translation),
            typeof(Rotation),
            typeof(AsteroidTagComponentData));

        bulletClientArchetype = manager.CreateArchetype(
            typeof(CurrentSimulatedPosition),
            typeof(CurrentSimulatedRotation),
            typeof(Translation),
            typeof(Rotation),
            typeof(BulletTagComponentData));
    }
    public ClientSettings(EntityManager manager)
    {
        var playerPrefab = Resources.Load("Prefabs/Ship") as GameObject;

        particleEmitter = playerPrefab.GetComponent <ParticleEmitterComponent>().Value;

        //TODO: This should come from the server via RPC at startup
        playerForce    = 50f;
        bulletVelocity = 500f;
    }