Install Entitas and first steps - DeniskaAb/EntitasRUS GitHub Wiki

Инсталляция Entitas

Каждый релиз публикуется с архивом в формате zip который содержит все исходные файлы которые вам необходимы:

Первый шаг

C# проект

Добавьте содержимое архива в ваш проект. Если вы желаете пользоваться кодогенерацией, вы должны самостоятельно создать вспомогательное консольное приложение, которое необходимо запускать после компиляции.

using System;
using System.Reflection;
using Entitas;
using Entitas.CodeGenerator;

class MainClass {
    public static void Main(string[] args) {
        generate();
    }

    static void generate() {

        // All code generators that should be used
        var codeGenerators = new ICodeGenerator[] {
            new ComponentIndicesGenerator(),
            new ComponentExtensionsGenerator(),
            new PoolAttributesGenerator(),
            new PoolsGenerator(),
            new BlueprintsGenerator()
        };

        // Specify all pools
        var poolNames = new [] { "Core", "Meta" };

        // Specify all blueprints
        var blueprintNames = new string[0];

        var assembly = Assembly.GetAssembly(typeof(Entity));
        var provider = new TypeReflectionProvider(assembly.GetTypes(), poolNames, blueprintNames);

        const string path = "../../Generated/";
        var files = CodeGenerator.Generate(provider, path, codeGenerators);

        foreach (var file in files) {
            Console.WriteLine(file.generatorName + ": " + file.fileName);
        }

        Console.WriteLine("Done. Press any key...");
        Console.Read();
    }
}

The project file must be updated in order to recognize the generated files. Add this to your .csproj

<ItemGroup>
  <Compile Include="path/to/generated/folder/**" />
</ItemGroup>

Unity project

Скопировать содержимое архива Entitas-Unity.zip в папку Assets которая находится в папке вашего проекта.

Откройте пункт меню Entitas Preferences находящийся в Menu Bar -> Entitas -> Preferences...

Entitas Preferences

Specify all the paths and set everything up to your liking. Use the generate button or the menu item

Menu Generate

Done. You're awesome! 🎉

Add pools, write some components and systems and make an awesome game. Feel free to share what you've created with Entitas in the Community Section in the Wiki and use #madeWithEntitas in your Tweets so we can all enjoy playing your game or learn from it!

https://github.com/sschmid/Entitas-CSharp/wiki/Games-and-Examples

⚠️ **GitHub.com Fallback** ⚠️