├── .gitignore ├── Assets ├── Game Code.meta ├── Game Code │ ├── Components.meta │ ├── Components │ │ ├── Components.cs │ │ └── Components.cs.meta │ ├── GameController.cs │ ├── GameController.cs.meta │ ├── Systems.meta │ └── Systems │ │ ├── Input.meta │ │ ├── Input │ │ ├── CommandMoveSystem.cs │ │ ├── CommandMoveSystem.cs.meta │ │ ├── CreateMoverSystem.cs │ │ ├── CreateMoverSystem.cs.meta │ │ ├── EmitInputSystem.cs │ │ ├── EmitInputSystem.cs.meta │ │ ├── InputSystems.cs │ │ └── InputSystems.cs.meta │ │ ├── Movement.meta │ │ ├── Movement │ │ ├── MoveSystem.cs │ │ ├── MoveSystem.cs.meta │ │ ├── MovementSystems.cs │ │ └── MovementSystems.cs.meta │ │ ├── View.meta │ │ └── View │ │ ├── AddViewSystem.cs │ │ ├── AddViewSystem.cs.meta │ │ ├── RenderDirectionSystem.cs │ │ ├── RenderDirectionSystem.cs.meta │ │ ├── RenderPositionSystem.cs │ │ ├── RenderPositionSystem.cs.meta │ │ ├── RenderSpriteSystem.cs │ │ ├── RenderSpriteSystem.cs.meta │ │ ├── ViewSystems.cs │ │ └── ViewSystems.cs.meta ├── Generated.meta ├── Generated │ ├── Contexts.cs │ ├── Contexts.cs.meta │ ├── Feature.cs │ ├── Feature.cs.meta │ ├── Game.meta │ ├── Game │ │ ├── Components.meta │ │ ├── Components │ │ │ ├── GameDirectionComponent.cs │ │ │ ├── GameDirectionComponent.cs.meta │ │ │ ├── GameMoveCompleteComponent.cs │ │ │ ├── GameMoveCompleteComponent.cs.meta │ │ │ ├── GameMoveComponent.cs │ │ │ ├── GameMoveComponent.cs.meta │ │ │ ├── GameMoverComponent.cs │ │ │ ├── GameMoverComponent.cs.meta │ │ │ ├── GamePositionComponent.cs │ │ │ ├── GamePositionComponent.cs.meta │ │ │ ├── GameSpriteComponent.cs │ │ │ ├── GameSpriteComponent.cs.meta │ │ │ ├── GameViewComponent.cs │ │ │ └── GameViewComponent.cs.meta │ │ ├── GameAttribute.cs │ │ ├── GameAttribute.cs.meta │ │ ├── GameComponentsLookup.cs │ │ ├── GameComponentsLookup.cs.meta │ │ ├── GameContext.cs │ │ ├── GameContext.cs.meta │ │ ├── GameEntity.cs │ │ ├── GameEntity.cs.meta │ │ ├── GameMatcher.cs │ │ └── GameMatcher.cs.meta │ ├── Input.meta │ └── Input │ │ ├── Components.meta │ │ ├── Components │ │ ├── InputLeftMouseComponent.cs │ │ ├── InputLeftMouseComponent.cs.meta │ │ ├── InputMouseDownComponent.cs │ │ ├── InputMouseDownComponent.cs.meta │ │ ├── InputMousePositionComponent.cs │ │ ├── InputMousePositionComponent.cs.meta │ │ ├── InputMouseUpComponent.cs │ │ ├── InputMouseUpComponent.cs.meta │ │ ├── InputRightMouseComponent.cs │ │ └── InputRightMouseComponent.cs.meta │ │ ├── InputAttribute.cs │ │ ├── InputAttribute.cs.meta │ │ ├── InputComponentsLookup.cs │ │ ├── InputComponentsLookup.cs.meta │ │ ├── InputContext.cs │ │ ├── InputContext.cs.meta │ │ ├── InputEntity.cs │ │ ├── InputEntity.cs.meta │ │ ├── InputMatcher.cs │ │ └── InputMatcher.cs.meta ├── Libraries.meta ├── Libraries │ ├── Enititas.meta │ └── Enititas │ │ ├── Compile.cs │ │ ├── Compile.cs.meta │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── Entitas.Blueprints.CodeGeneration.Plugins.dll │ │ ├── Entitas.Blueprints.CodeGeneration.Plugins.dll.meta │ │ ├── Entitas.Blueprints.Unity.Editor.dll │ │ ├── Entitas.Blueprints.Unity.Editor.dll.meta │ │ ├── Entitas.CodeGeneration.CodeGenerator.dll │ │ ├── Entitas.CodeGeneration.CodeGenerator.dll.meta │ │ ├── Entitas.CodeGeneration.Plugins.dll │ │ ├── Entitas.CodeGeneration.Plugins.dll.meta │ │ ├── Entitas.CodeGeneration.Unity.Editor.dll │ │ ├── Entitas.CodeGeneration.Unity.Editor.dll.meta │ │ ├── Entitas.CodeGeneration.dll │ │ ├── Entitas.CodeGeneration.dll.meta │ │ ├── Entitas.Migration.Unity.Editor.dll │ │ ├── Entitas.Migration.Unity.Editor.dll.meta │ │ ├── Entitas.Migration.dll │ │ ├── Entitas.Migration.dll.meta │ │ ├── Entitas.Unity.Editor.dll │ │ ├── Entitas.Unity.Editor.dll.meta │ │ ├── Entitas.VisualDebugging.CodeGeneration.Plugins.dll │ │ ├── Entitas.VisualDebugging.CodeGeneration.Plugins.dll.meta │ │ ├── Entitas.VisualDebugging.Unity.Editor.dll │ │ ├── Entitas.VisualDebugging.Unity.Editor.dll.meta │ │ ├── Images.meta │ │ └── Images │ │ │ ├── EntitasContextErrorHierarchyIcon.png │ │ │ ├── EntitasContextErrorHierarchyIcon.png.meta │ │ │ ├── EntitasContextHierarchyIcon.png │ │ │ ├── EntitasContextHierarchyIcon.png.meta │ │ │ ├── EntitasEntityErrorHierarchyIcon.png │ │ │ ├── EntitasEntityErrorHierarchyIcon.png.meta │ │ │ ├── EntitasEntityHierarchyIcon.png │ │ │ ├── EntitasEntityHierarchyIcon.png.meta │ │ │ ├── EntitasHeader.png │ │ │ ├── EntitasHeader.png.meta │ │ │ ├── EntitasSystemsErrorHierarchyIcon.png │ │ │ ├── EntitasSystemsErrorHierarchyIcon.png.meta │ │ │ ├── EntitasSystemsHierarchyIcon.png │ │ │ └── EntitasSystemsHierarchyIcon.png.meta │ │ ├── Entitas.Blueprints.Unity.dll │ │ ├── Entitas.Blueprints.Unity.dll.meta │ │ ├── Entitas.Blueprints.dll │ │ ├── Entitas.Blueprints.dll.meta │ │ ├── Entitas.CodeGeneration.Attributes.dll │ │ ├── Entitas.CodeGeneration.Attributes.dll.meta │ │ ├── Entitas.Unity.dll │ │ ├── Entitas.Unity.dll.meta │ │ ├── Entitas.Utils.dll │ │ ├── Entitas.Utils.dll.meta │ │ ├── Entitas.VisualDebugging.Unity.dll │ │ ├── Entitas.VisualDebugging.Unity.dll.meta │ │ ├── Entitas.dll │ │ ├── Entitas.dll.meta │ │ ├── fabl.dll │ │ └── fabl.dll.meta ├── Resources.meta ├── Resources │ ├── Bee.psd │ └── Bee.psd.meta ├── Scenes.meta ├── Scenes │ ├── GameScene.unity │ └── GameScene.unity.meta └── StreamingAssets.meta ├── Entitas.properties ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset ├── README.md └── Screenshots └── Preferences.png /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uilds/ 5 | 6 | # Windows 7 | Thumbs.db 8 | 9 | # Mac 10 | .DS_Store 11 | 12 | # Autogenerated VS/MD solution and project files 13 | *.csproj 14 | *.unityproj 15 | *.unitypackage 16 | *.sln 17 | *.suo 18 | *.tmp 19 | *.user 20 | *.userprefs 21 | *.pidb 22 | *.booproj 23 | 24 | # Unity3D generated meta files 25 | *.pidb.meta 26 | 27 | # Unity3D Generated File On Crash Reports 28 | sysinfo.txt 29 | -------------------------------------------------------------------------------- /Assets/Game Code.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3677a5901255dbf459dba49fa9f3eb6f 3 | folderAsset: yes 4 | timeCreated: 1493132110 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Game Code/Components.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fdd9d4733255bd49b4ef4597dba5cb9 3 | folderAsset: yes 4 | timeCreated: 1493132122 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Game Code/Components/Components.cs: -------------------------------------------------------------------------------- 1 | using Entitas; 2 | using Entitas.CodeGeneration.Attributes; 3 | using UnityEngine; 4 | 5 | // Game Components 6 | [Game] 7 | public class PositionComponent : IComponent 8 | { 9 | public Vector2 value; 10 | } 11 | 12 | [Game] 13 | public class MoveComponent : IComponent 14 | { 15 | public Vector2 target; 16 | } 17 | 18 | [Game] 19 | public class MoverComponent : IComponent 20 | { 21 | } 22 | 23 | [Game] 24 | public class MoveCompleteComponent : IComponent 25 | { 26 | } 27 | 28 | [Game] 29 | public class DirectionComponent : IComponent 30 | { 31 | public float value; 32 | } 33 | 34 | [Game] 35 | public class SpriteComponent : IComponent 36 | { 37 | public string name; 38 | } 39 | 40 | [Game] 41 | public class ViewComponent : IComponent 42 | { 43 | public GameObject gameObject; 44 | } 45 | 46 | 47 | // Input Components 48 | [Input, Unique] 49 | public class LeftMouseComponent : IComponent 50 | { 51 | } 52 | 53 | [Input, Unique] 54 | public class RightMouseComponent : IComponent 55 | { 56 | } 57 | 58 | [Input] 59 | public class MouseDownComponent : IComponent 60 | { 61 | public Vector2 position; 62 | } 63 | 64 | [Input] 65 | public class MousePositionComponent : IComponent 66 | { 67 | public Vector2 position; 68 | } 69 | 70 | [Input] 71 | public class MouseUpComponent : IComponent 72 | { 73 | public Vector2 position; 74 | } 75 | -------------------------------------------------------------------------------- /Assets/Game Code/Components/Components.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4c1d992a536b3c489ff10ba0208829a 3 | timeCreated: 1493132781 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Game Code/GameController.cs: -------------------------------------------------------------------------------- 1 | using Entitas; 2 | using UnityEngine; 3 | 4 | public class GameController : MonoBehaviour 5 | { 6 | private Systems _systems; 7 | private Contexts _contexts; 8 | 9 | void Start() 10 | { 11 | _contexts = Contexts.sharedInstance; 12 | _systems = CreateSystems(_contexts); 13 | _systems.Initialize(); 14 | } 15 | 16 | void Update() 17 | { 18 | _systems.Execute(); 19 | _systems.Cleanup(); 20 | } 21 | 22 | private static Systems CreateSystems(Contexts contexts) 23 | { 24 | return new Feature("Systems") 25 | .Add(new InputSystems(contexts)) 26 | .Add(new MovementSystems(contexts)) 27 | .Add(new ViewSystems(contexts)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Assets/Game Code/GameController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b54f91f139e1d0845babf62bcc20d34e 3 | timeCreated: 1493132140 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79fda1469f19494408c6209e7286d9c5 3 | folderAsset: yes 4 | timeCreated: 1493132127 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Input.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3d137b201f444d49a8413b92b47d4ad 3 | folderAsset: yes 4 | timeCreated: 1493135679 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Input/CommandMoveSystem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Entitas; 3 | using UnityEngine; 4 | 5 | public class CommandMoveSystem : ReactiveSystem 6 | { 7 | readonly GameContext _gameContext; 8 | readonly IGroup _movers; 9 | 10 | public CommandMoveSystem(Contexts contexts) : base(contexts.input) 11 | { 12 | _movers = contexts.game.GetGroup(GameMatcher.AllOf(GameMatcher.Mover).NoneOf(GameMatcher.Move)); 13 | } 14 | 15 | protected override Collector GetTrigger(IContext context) 16 | { 17 | return context.CreateCollector(InputMatcher.AllOf(InputMatcher.LeftMouse, InputMatcher.MouseDown)); 18 | } 19 | 20 | protected override bool Filter(InputEntity entity) 21 | { 22 | return entity.hasMouseDown; 23 | } 24 | 25 | protected override void Execute(List entities) 26 | { 27 | foreach (InputEntity e in entities) 28 | { 29 | GameEntity[] movers = _movers.GetEntities(); 30 | if (movers.Length <= 0) return; 31 | 32 | GameEntity mover = movers[Random.Range(0, movers.Length)]; 33 | mover.AddMove(e.mouseDown.position); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Input/CommandMoveSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3e7da8226048be4e8282aeb09c42d43 3 | timeCreated: 1493136680 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Input/CreateMoverSystem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Entitas; 3 | using UnityEngine; 4 | 5 | public class CreateMoverSystem : ReactiveSystem 6 | { 7 | readonly GameContext _gameContext; 8 | 9 | public CreateMoverSystem(Contexts contexts) : base(contexts.input) 10 | { 11 | _gameContext = contexts.game; 12 | } 13 | 14 | protected override Collector GetTrigger(IContext context) 15 | { 16 | return context.CreateCollector(InputMatcher.AllOf(InputMatcher.RightMouse, InputMatcher.MouseDown)); 17 | } 18 | 19 | protected override bool Filter(InputEntity entity) 20 | { 21 | return entity.hasMouseDown; 22 | } 23 | 24 | protected override void Execute(List entities) 25 | { 26 | foreach (InputEntity e in entities) 27 | { 28 | GameEntity mover = _gameContext.CreateEntity(); 29 | mover.isMover = true; 30 | mover.AddPosition(e.mouseDown.position); 31 | mover.AddDirection(Random.Range(0,360)); 32 | mover.AddSprite("Bee"); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Input/CreateMoverSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7015f5d7a8a3174ab9c30b31b39e04a 3 | timeCreated: 1493135679 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Input/EmitInputSystem.cs: -------------------------------------------------------------------------------- 1 | using Entitas; 2 | using UnityEngine; 3 | 4 | public class EmitInputSystem : IInitializeSystem, IExecuteSystem 5 | { 6 | readonly InputContext _context; 7 | private InputEntity _leftMouseEntity; 8 | private InputEntity _rightMouseEntity; 9 | 10 | public EmitInputSystem(Contexts contexts) 11 | { 12 | _context = contexts.input; 13 | } 14 | 15 | public void Initialize() 16 | { 17 | // initialise the unique entities that will hold the mousee button data 18 | _context.isLeftMouse = true; 19 | _leftMouseEntity = _context.leftMouseEntity; 20 | 21 | _context.isRightMouse = true; 22 | _rightMouseEntity = _context.rightMouseEntity; 23 | } 24 | 25 | public void Execute() 26 | { 27 | // mouse position 28 | Vector2 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition); 29 | 30 | // left mouse button 31 | if (Input.GetMouseButtonDown(0)) 32 | _leftMouseEntity.ReplaceMouseDown(mousePosition); 33 | 34 | if (Input.GetMouseButton(0)) 35 | _leftMouseEntity.ReplaceMousePosition(mousePosition); 36 | 37 | if (Input.GetMouseButtonUp(0)) 38 | _leftMouseEntity.ReplaceMouseUp(mousePosition); 39 | 40 | 41 | // left mouse button 42 | if (Input.GetMouseButtonDown(1)) 43 | _rightMouseEntity.ReplaceMouseDown(mousePosition); 44 | 45 | if (Input.GetMouseButton(1)) 46 | _rightMouseEntity.ReplaceMousePosition(mousePosition); 47 | 48 | if (Input.GetMouseButtonUp(1)) 49 | _rightMouseEntity.ReplaceMouseUp(mousePosition); 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Input/EmitInputSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8197413d71854dc41b79204bfbb80f7a 3 | timeCreated: 1493135679 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Input/InputSystems.cs: -------------------------------------------------------------------------------- 1 | using Entitas; 2 | 3 | public class InputSystems : Feature 4 | { 5 | public InputSystems(Contexts contexts) : base("Input Systems") 6 | { 7 | Add(new EmitInputSystem(contexts)); 8 | Add(new CreateMoverSystem(contexts)); 9 | Add(new CommandMoveSystem(contexts)); 10 | } 11 | } -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Input/InputSystems.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4752f7d8fdffc1d4e9a5c83f7b785b18 3 | timeCreated: 1493135679 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Movement.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae43fa9d95c36ac468fcf3e8ba498e3f 3 | folderAsset: yes 4 | timeCreated: 1493133186 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Movement/MoveSystem.cs: -------------------------------------------------------------------------------- 1 | using Entitas; 2 | using UnityEngine; 3 | 4 | public class MoveSystem : IExecuteSystem, ICleanupSystem 5 | { 6 | readonly IGroup _moves; 7 | readonly IGroup _moveCompletes; 8 | const float _speed = 4f; 9 | 10 | public MoveSystem(Contexts contexts) 11 | { 12 | _moves = contexts.game.GetGroup(GameMatcher.Move); 13 | _moveCompletes = contexts.game.GetGroup(GameMatcher.MoveComplete); 14 | } 15 | 16 | public void Execute() 17 | { 18 | foreach (GameEntity e in _moves.GetEntities()) 19 | { 20 | Vector2 dir = e.move.target - e.position.value; 21 | Vector2 newPosition = e.position.value + dir.normalized * _speed * Time.deltaTime; 22 | e.ReplacePosition(newPosition); 23 | 24 | float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg; 25 | e.ReplaceDirection(angle); 26 | 27 | float dist = dir.magnitude; 28 | if (dist <= 0.5f) 29 | { 30 | e.RemoveMove(); 31 | e.isMoveComplete = true; 32 | } 33 | } 34 | } 35 | 36 | public void Cleanup() 37 | { 38 | foreach (GameEntity e in _moveCompletes.GetEntities()) 39 | { 40 | e.isMoveComplete = false; 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Movement/MoveSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ec97c7f4635a484ea778deb594c3061 3 | timeCreated: 1493136190 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Movement/MovementSystems.cs: -------------------------------------------------------------------------------- 1 | using Entitas; 2 | 3 | public class MovementSystems : Feature 4 | { 5 | public MovementSystems(Contexts contexts) : base("Movement Systems") 6 | { 7 | Add(new MoveSystem(contexts)); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/Movement/MovementSystems.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f18f5efdd361a7349a41aa76f709fc73 3 | timeCreated: 1493133194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/View.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a87ec20965e7c34ab1f82305e7bb15f 3 | folderAsset: yes 4 | timeCreated: 1493134113 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/View/AddViewSystem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Entitas; 3 | using Entitas.Unity; 4 | using UnityEngine; 5 | 6 | public class AddViewSystem : ReactiveSystem 7 | { 8 | readonly Transform _viewContainer = new GameObject("Game Views").transform; 9 | readonly GameContext _context; 10 | 11 | public AddViewSystem(Contexts contexts) : base(contexts.game) 12 | { 13 | _context = contexts.game; 14 | } 15 | 16 | protected override Collector GetTrigger(IContext context) 17 | { 18 | return context.CreateCollector(GameMatcher.Sprite); 19 | } 20 | 21 | protected override bool Filter(GameEntity entity) 22 | { 23 | return entity.hasSprite && !entity.hasView; 24 | } 25 | 26 | protected override void Execute(List entities) 27 | { 28 | foreach (GameEntity e in entities) 29 | { 30 | GameObject go = new GameObject("Game View"); 31 | go.transform.SetParent(_viewContainer, false); 32 | e.AddView(go); 33 | go.Link(e, _context); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Assets/Game Code/Systems/View/AddViewSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84a7be8b287990b4fb952f48db88f14f 3 | timeCreated: 1493134113 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/View/RenderDirectionSystem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Entitas; 3 | using Entitas.Unity; 4 | using UnityEngine; 5 | 6 | public class RenderDirectionSystem : ReactiveSystem 7 | { 8 | readonly GameContext _context; 9 | 10 | public RenderDirectionSystem(Contexts contexts) : base(contexts.game) 11 | { 12 | _context = contexts.game; 13 | } 14 | 15 | protected override Collector GetTrigger(IContext context) 16 | { 17 | return context.CreateCollector(GameMatcher.Direction); 18 | } 19 | 20 | protected override bool Filter(GameEntity entity) 21 | { 22 | return entity.hasDirection && entity.hasView; 23 | } 24 | 25 | protected override void Execute(List entities) 26 | { 27 | foreach (GameEntity e in entities) 28 | { 29 | float ang = e.direction.value; 30 | e.view.gameObject.transform.rotation = Quaternion.AngleAxis(ang - 90, Vector3.forward); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Assets/Game Code/Systems/View/RenderDirectionSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5cab13cbf4c455f44a474946c16a7c81 3 | timeCreated: 1493134113 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/View/RenderPositionSystem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Entitas; 3 | 4 | public class RenderPositionSystem : ReactiveSystem 5 | { 6 | public RenderPositionSystem(Contexts contexts) : base(contexts.game) 7 | { 8 | } 9 | 10 | protected override Collector GetTrigger(IContext context) 11 | { 12 | return context.CreateCollector(GameMatcher.Position); 13 | } 14 | 15 | protected override bool Filter(GameEntity entity) 16 | { 17 | return entity.hasPosition && entity.hasView; 18 | } 19 | 20 | protected override void Execute(List entities) 21 | { 22 | foreach (GameEntity e in entities) 23 | { 24 | e.view.gameObject.transform.position = e.position.value; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Assets/Game Code/Systems/View/RenderPositionSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53b76b0b90c58af4f9d2411ad58068bb 3 | timeCreated: 1493134113 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/View/RenderSpriteSystem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Entitas; 3 | using Entitas.Unity; 4 | using UnityEngine; 5 | 6 | public class RenderSpriteSystem : ReactiveSystem 7 | { 8 | public RenderSpriteSystem(Contexts contexts) : base(contexts.game) 9 | { 10 | } 11 | 12 | protected override Collector GetTrigger(IContext context) 13 | { 14 | return context.CreateCollector(GameMatcher.Sprite); 15 | } 16 | 17 | protected override bool Filter(GameEntity entity) 18 | { 19 | return entity.hasSprite && entity.hasView; 20 | } 21 | 22 | protected override void Execute(List entities) 23 | { 24 | foreach (GameEntity e in entities) 25 | { 26 | GameObject go = e.view.gameObject; 27 | SpriteRenderer sr = go.GetComponent(); 28 | if (sr == null) sr = go.AddComponent(); 29 | sr.sprite = Resources.Load(e.sprite.name); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Assets/Game Code/Systems/View/RenderSpriteSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0154c456990f3249ad2e0572d9fbcc2 3 | timeCreated: 1493136190 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/View/ViewSystems.cs: -------------------------------------------------------------------------------- 1 | using Entitas; 2 | 3 | public class ViewSystems : Feature 4 | { 5 | public ViewSystems(Contexts contexts) : base("View Systems") 6 | { 7 | Add(new AddViewSystem(contexts)); 8 | Add(new RenderSpriteSystem(contexts)); 9 | Add(new RenderPositionSystem(contexts)); 10 | Add(new RenderDirectionSystem(contexts)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Assets/Game Code/Systems/View/ViewSystems.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd168b93f768cdc4981c787420c76384 3 | timeCreated: 1493134114 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a39ef671f1970d3419cefe7027114ab7 3 | folderAsset: yes 4 | timeCreated: 1493132615 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Generated/Contexts.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ContextsGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public partial class Contexts : Entitas.IContexts { 10 | 11 | public static Contexts sharedInstance { 12 | get { 13 | if (_sharedInstance == null) { 14 | _sharedInstance = new Contexts(); 15 | } 16 | 17 | return _sharedInstance; 18 | } 19 | set { _sharedInstance = value; } 20 | } 21 | 22 | static Contexts _sharedInstance; 23 | 24 | public GameContext game { get; set; } 25 | public InputContext input { get; set; } 26 | 27 | public Entitas.IContext[] allContexts { get { return new Entitas.IContext [] { game, input }; } } 28 | 29 | public Contexts() { 30 | game = new GameContext(); 31 | input = new InputContext(); 32 | 33 | var postConstructors = System.Linq.Enumerable.Where( 34 | GetType().GetMethods(), 35 | method => System.Attribute.IsDefined(method, typeof(Entitas.CodeGeneration.Attributes.PostConstructorAttribute)) 36 | ); 37 | 38 | foreach (var postConstructor in postConstructors) { 39 | postConstructor.Invoke(this, null); 40 | } 41 | } 42 | 43 | public void Reset() { 44 | var contexts = allContexts; 45 | for (int i = 0; i < contexts.Length; i++) { 46 | contexts[i].Reset(); 47 | } 48 | } 49 | } 50 | 51 | //------------------------------------------------------------------------------ 52 | // 53 | // This code was generated by Entitas.VisualDebugging.CodeGeneration.Plugins.ContextObserverGenerator. 54 | // 55 | // Changes to this file may cause incorrect behavior and will be lost if 56 | // the code is regenerated. 57 | // 58 | //------------------------------------------------------------------------------ 59 | public partial class Contexts { 60 | 61 | #if (!ENTITAS_DISABLE_VISUAL_DEBUGGING && UNITY_EDITOR) 62 | 63 | [Entitas.CodeGeneration.Attributes.PostConstructor] 64 | public void InitializeContexObservers() { 65 | CreateContextObserver(game); 66 | CreateContextObserver(input); 67 | } 68 | 69 | public void CreateContextObserver(Entitas.IContext context) { 70 | try { 71 | if (UnityEngine.Application.isPlaying) { 72 | var observer = new Entitas.VisualDebugging.Unity.ContextObserver(context); 73 | UnityEngine.Object.DontDestroyOnLoad(observer.gameObject); 74 | } 75 | } catch(System.Exception) { 76 | } 77 | } 78 | 79 | #endif 80 | } 81 | -------------------------------------------------------------------------------- /Assets/Generated/Contexts.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b53c029d9a829f04b895715a3b96017a 3 | timeCreated: 1493137622 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Feature.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.VisualDebugging.CodeGeneration.Plugins.FeatureClassGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | #if (!ENTITAS_DISABLE_VISUAL_DEBUGGING && UNITY_EDITOR) 10 | 11 | public class Feature : Entitas.VisualDebugging.Unity.DebugSystems { 12 | 13 | public Feature(string name) : base(name) { 14 | } 15 | 16 | public Feature() : base(true) { 17 | var typeName = Entitas.Utils.TypeSerializationExtension.ToCompilableString(GetType()); 18 | var shortType = Entitas.Utils.TypeSerializationExtension.ShortTypeName(typeName); 19 | var readableType = Entitas.Utils.StringExtension.ToSpacedCamelCase(shortType); 20 | 21 | initialize(readableType); 22 | } 23 | } 24 | 25 | #else 26 | 27 | public class Feature : Entitas.Systems { 28 | 29 | public Feature(string name) { 30 | } 31 | 32 | public Feature() { 33 | } 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Assets/Generated/Feature.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49fa52a252246484b8a849c16070d43e 3 | timeCreated: 1493137622 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Game.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cac163327f87ad4a951e3c27e4b0a79 3 | folderAsset: yes 4 | timeCreated: 1493137622 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb2212f39031b9146b69c4f283b946c4 3 | folderAsset: yes 4 | timeCreated: 1493137680 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GameDirectionComponent.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public partial class GameEntity { 10 | 11 | public DirectionComponent direction { get { return (DirectionComponent)GetComponent(GameComponentsLookup.Direction); } } 12 | public bool hasDirection { get { return HasComponent(GameComponentsLookup.Direction); } } 13 | 14 | public void AddDirection(float newValue) { 15 | var index = GameComponentsLookup.Direction; 16 | var component = CreateComponent(index); 17 | component.value = newValue; 18 | AddComponent(index, component); 19 | } 20 | 21 | public void ReplaceDirection(float newValue) { 22 | var index = GameComponentsLookup.Direction; 23 | var component = CreateComponent(index); 24 | component.value = newValue; 25 | ReplaceComponent(index, component); 26 | } 27 | 28 | public void RemoveDirection() { 29 | RemoveComponent(GameComponentsLookup.Direction); 30 | } 31 | } 32 | 33 | //------------------------------------------------------------------------------ 34 | // 35 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator. 36 | // 37 | // Changes to this file may cause incorrect behavior and will be lost if 38 | // the code is regenerated. 39 | // 40 | //------------------------------------------------------------------------------ 41 | public sealed partial class GameMatcher { 42 | 43 | static Entitas.IMatcher _matcherDirection; 44 | 45 | public static Entitas.IMatcher Direction { 46 | get { 47 | if (_matcherDirection == null) { 48 | var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(GameComponentsLookup.Direction); 49 | matcher.componentNames = GameComponentsLookup.componentNames; 50 | _matcherDirection = matcher; 51 | } 52 | 53 | return _matcherDirection; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GameDirectionComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2f0f90f0adf0d64daf00d242507329c 3 | timeCreated: 1493137681 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GameMoveCompleteComponent.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public partial class GameEntity { 10 | 11 | static readonly MoveCompleteComponent moveCompleteComponent = new MoveCompleteComponent(); 12 | 13 | public bool isMoveComplete { 14 | get { return HasComponent(GameComponentsLookup.MoveComplete); } 15 | set { 16 | if (value != isMoveComplete) { 17 | if (value) { 18 | AddComponent(GameComponentsLookup.MoveComplete, moveCompleteComponent); 19 | } else { 20 | RemoveComponent(GameComponentsLookup.MoveComplete); 21 | } 22 | } 23 | } 24 | } 25 | } 26 | 27 | //------------------------------------------------------------------------------ 28 | // 29 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator. 30 | // 31 | // Changes to this file may cause incorrect behavior and will be lost if 32 | // the code is regenerated. 33 | // 34 | //------------------------------------------------------------------------------ 35 | public sealed partial class GameMatcher { 36 | 37 | static Entitas.IMatcher _matcherMoveComplete; 38 | 39 | public static Entitas.IMatcher MoveComplete { 40 | get { 41 | if (_matcherMoveComplete == null) { 42 | var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(GameComponentsLookup.MoveComplete); 43 | matcher.componentNames = GameComponentsLookup.componentNames; 44 | _matcherMoveComplete = matcher; 45 | } 46 | 47 | return _matcherMoveComplete; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GameMoveCompleteComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83f08526f0b6efd42accd3b285ac92f5 3 | timeCreated: 1493137681 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GameMoveComponent.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public partial class GameEntity { 10 | 11 | public MoveComponent move { get { return (MoveComponent)GetComponent(GameComponentsLookup.Move); } } 12 | public bool hasMove { get { return HasComponent(GameComponentsLookup.Move); } } 13 | 14 | public void AddMove(UnityEngine.Vector2 newTarget) { 15 | var index = GameComponentsLookup.Move; 16 | var component = CreateComponent(index); 17 | component.target = newTarget; 18 | AddComponent(index, component); 19 | } 20 | 21 | public void ReplaceMove(UnityEngine.Vector2 newTarget) { 22 | var index = GameComponentsLookup.Move; 23 | var component = CreateComponent(index); 24 | component.target = newTarget; 25 | ReplaceComponent(index, component); 26 | } 27 | 28 | public void RemoveMove() { 29 | RemoveComponent(GameComponentsLookup.Move); 30 | } 31 | } 32 | 33 | //------------------------------------------------------------------------------ 34 | // 35 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator. 36 | // 37 | // Changes to this file may cause incorrect behavior and will be lost if 38 | // the code is regenerated. 39 | // 40 | //------------------------------------------------------------------------------ 41 | public sealed partial class GameMatcher { 42 | 43 | static Entitas.IMatcher _matcherMove; 44 | 45 | public static Entitas.IMatcher Move { 46 | get { 47 | if (_matcherMove == null) { 48 | var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(GameComponentsLookup.Move); 49 | matcher.componentNames = GameComponentsLookup.componentNames; 50 | _matcherMove = matcher; 51 | } 52 | 53 | return _matcherMove; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GameMoveComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9f85f96a872d1e40af6d1eb706325b9 3 | timeCreated: 1493137681 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GameMoverComponent.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public partial class GameEntity { 10 | 11 | static readonly MoverComponent moverComponent = new MoverComponent(); 12 | 13 | public bool isMover { 14 | get { return HasComponent(GameComponentsLookup.Mover); } 15 | set { 16 | if (value != isMover) { 17 | if (value) { 18 | AddComponent(GameComponentsLookup.Mover, moverComponent); 19 | } else { 20 | RemoveComponent(GameComponentsLookup.Mover); 21 | } 22 | } 23 | } 24 | } 25 | } 26 | 27 | //------------------------------------------------------------------------------ 28 | // 29 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator. 30 | // 31 | // Changes to this file may cause incorrect behavior and will be lost if 32 | // the code is regenerated. 33 | // 34 | //------------------------------------------------------------------------------ 35 | public sealed partial class GameMatcher { 36 | 37 | static Entitas.IMatcher _matcherMover; 38 | 39 | public static Entitas.IMatcher Mover { 40 | get { 41 | if (_matcherMover == null) { 42 | var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(GameComponentsLookup.Mover); 43 | matcher.componentNames = GameComponentsLookup.componentNames; 44 | _matcherMover = matcher; 45 | } 46 | 47 | return _matcherMover; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GameMoverComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f65eeb1b5a597a84eaaba5ad2ae26048 3 | timeCreated: 1493137681 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GamePositionComponent.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public partial class GameEntity { 10 | 11 | public PositionComponent position { get { return (PositionComponent)GetComponent(GameComponentsLookup.Position); } } 12 | public bool hasPosition { get { return HasComponent(GameComponentsLookup.Position); } } 13 | 14 | public void AddPosition(UnityEngine.Vector2 newValue) { 15 | var index = GameComponentsLookup.Position; 16 | var component = CreateComponent(index); 17 | component.value = newValue; 18 | AddComponent(index, component); 19 | } 20 | 21 | public void ReplacePosition(UnityEngine.Vector2 newValue) { 22 | var index = GameComponentsLookup.Position; 23 | var component = CreateComponent(index); 24 | component.value = newValue; 25 | ReplaceComponent(index, component); 26 | } 27 | 28 | public void RemovePosition() { 29 | RemoveComponent(GameComponentsLookup.Position); 30 | } 31 | } 32 | 33 | //------------------------------------------------------------------------------ 34 | // 35 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator. 36 | // 37 | // Changes to this file may cause incorrect behavior and will be lost if 38 | // the code is regenerated. 39 | // 40 | //------------------------------------------------------------------------------ 41 | public sealed partial class GameMatcher { 42 | 43 | static Entitas.IMatcher _matcherPosition; 44 | 45 | public static Entitas.IMatcher Position { 46 | get { 47 | if (_matcherPosition == null) { 48 | var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(GameComponentsLookup.Position); 49 | matcher.componentNames = GameComponentsLookup.componentNames; 50 | _matcherPosition = matcher; 51 | } 52 | 53 | return _matcherPosition; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GamePositionComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2823b5d9ebf71b64e85293cdfb9d8d6c 3 | timeCreated: 1493137680 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GameSpriteComponent.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public partial class GameEntity { 10 | 11 | public SpriteComponent sprite { get { return (SpriteComponent)GetComponent(GameComponentsLookup.Sprite); } } 12 | public bool hasSprite { get { return HasComponent(GameComponentsLookup.Sprite); } } 13 | 14 | public void AddSprite(string newName) { 15 | var index = GameComponentsLookup.Sprite; 16 | var component = CreateComponent(index); 17 | component.name = newName; 18 | AddComponent(index, component); 19 | } 20 | 21 | public void ReplaceSprite(string newName) { 22 | var index = GameComponentsLookup.Sprite; 23 | var component = CreateComponent(index); 24 | component.name = newName; 25 | ReplaceComponent(index, component); 26 | } 27 | 28 | public void RemoveSprite() { 29 | RemoveComponent(GameComponentsLookup.Sprite); 30 | } 31 | } 32 | 33 | //------------------------------------------------------------------------------ 34 | // 35 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator. 36 | // 37 | // Changes to this file may cause incorrect behavior and will be lost if 38 | // the code is regenerated. 39 | // 40 | //------------------------------------------------------------------------------ 41 | public sealed partial class GameMatcher { 42 | 43 | static Entitas.IMatcher _matcherSprite; 44 | 45 | public static Entitas.IMatcher Sprite { 46 | get { 47 | if (_matcherSprite == null) { 48 | var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(GameComponentsLookup.Sprite); 49 | matcher.componentNames = GameComponentsLookup.componentNames; 50 | _matcherSprite = matcher; 51 | } 52 | 53 | return _matcherSprite; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GameSpriteComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53d56c46e9707604dae0170a31af5f51 3 | timeCreated: 1493137681 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GameViewComponent.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public partial class GameEntity { 10 | 11 | public ViewComponent view { get { return (ViewComponent)GetComponent(GameComponentsLookup.View); } } 12 | public bool hasView { get { return HasComponent(GameComponentsLookup.View); } } 13 | 14 | public void AddView(UnityEngine.GameObject newGameObject) { 15 | var index = GameComponentsLookup.View; 16 | var component = CreateComponent(index); 17 | component.gameObject = newGameObject; 18 | AddComponent(index, component); 19 | } 20 | 21 | public void ReplaceView(UnityEngine.GameObject newGameObject) { 22 | var index = GameComponentsLookup.View; 23 | var component = CreateComponent(index); 24 | component.gameObject = newGameObject; 25 | ReplaceComponent(index, component); 26 | } 27 | 28 | public void RemoveView() { 29 | RemoveComponent(GameComponentsLookup.View); 30 | } 31 | } 32 | 33 | //------------------------------------------------------------------------------ 34 | // 35 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator. 36 | // 37 | // Changes to this file may cause incorrect behavior and will be lost if 38 | // the code is regenerated. 39 | // 40 | //------------------------------------------------------------------------------ 41 | public sealed partial class GameMatcher { 42 | 43 | static Entitas.IMatcher _matcherView; 44 | 45 | public static Entitas.IMatcher View { 46 | get { 47 | if (_matcherView == null) { 48 | var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(GameComponentsLookup.View); 49 | matcher.componentNames = GameComponentsLookup.componentNames; 50 | _matcherView = matcher; 51 | } 52 | 53 | return _matcherView; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Assets/Generated/Game/Components/GameViewComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 124a5065660f8fb48bedacf093b9cbf5 3 | timeCreated: 1493137680 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Game/GameAttribute.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ContextAttributeGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public sealed class GameAttribute : Entitas.CodeGeneration.Attributes.ContextAttribute { 10 | 11 | public GameAttribute() : base("Game") { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Assets/Generated/Game/GameAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fbb6457ab8ad69d429f9ca57733a8884 3 | timeCreated: 1493137622 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Game/GameComponentsLookup.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentsLookupGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public static class GameComponentsLookup { 10 | 11 | public const int Direction = 0; 12 | public const int MoveComplete = 1; 13 | public const int Move = 2; 14 | public const int Mover = 3; 15 | public const int Position = 4; 16 | public const int Sprite = 5; 17 | public const int View = 6; 18 | 19 | public const int TotalComponents = 7; 20 | 21 | public static readonly string[] componentNames = { 22 | "Direction", 23 | "MoveComplete", 24 | "Move", 25 | "Mover", 26 | "Position", 27 | "Sprite", 28 | "View" 29 | }; 30 | 31 | public static readonly System.Type[] componentTypes = { 32 | typeof(DirectionComponent), 33 | typeof(MoveCompleteComponent), 34 | typeof(MoveComponent), 35 | typeof(MoverComponent), 36 | typeof(PositionComponent), 37 | typeof(SpriteComponent), 38 | typeof(ViewComponent) 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /Assets/Generated/Game/GameComponentsLookup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55b26afe71714a24995279bb7f93fcce 3 | timeCreated: 1493137622 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Game/GameContext.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ContextGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public sealed partial class GameContext : Entitas.Context { 10 | 11 | public GameContext() 12 | : base( 13 | GameComponentsLookup.TotalComponents, 14 | 0, 15 | new Entitas.ContextInfo( 16 | "Game", 17 | GameComponentsLookup.componentNames, 18 | GameComponentsLookup.componentTypes 19 | ), 20 | (entity) => 21 | 22 | #if (ENTITAS_FAST_AND_UNSAFE) 23 | new Entitas.UnsafeAERC() 24 | #else 25 | new Entitas.SafeAERC(entity) 26 | #endif 27 | 28 | ) { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Assets/Generated/Game/GameContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a34b4c6b3342dcb45b6ea8d59a67ab0f 3 | timeCreated: 1493137622 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Game/GameEntity.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.EntityGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public sealed partial class GameEntity : Entitas.Entity { 10 | } 11 | -------------------------------------------------------------------------------- /Assets/Generated/Game/GameEntity.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09390c36a4a100047b43943de448fda8 3 | timeCreated: 1493137622 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Game/GameMatcher.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ContextMatcherGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public sealed partial class GameMatcher { 10 | 11 | public static Entitas.IAllOfMatcher AllOf(params int[] indices) { 12 | return Entitas.Matcher.AllOf(indices); 13 | } 14 | 15 | public static Entitas.IAllOfMatcher AllOf(params Entitas.IMatcher[] matchers) { 16 | return Entitas.Matcher.AllOf(matchers); 17 | } 18 | 19 | public static Entitas.IAnyOfMatcher AnyOf(params int[] indices) { 20 | return Entitas.Matcher.AnyOf(indices); 21 | } 22 | 23 | public static Entitas.IAnyOfMatcher AnyOf(params Entitas.IMatcher[] matchers) { 24 | return Entitas.Matcher.AnyOf(matchers); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Assets/Generated/Game/GameMatcher.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6810c3b514049cf45a52e88a0c0ad26d 3 | timeCreated: 1493137622 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Input.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1984497c71c58d441a1d6efdc5008c6c 3 | folderAsset: yes 4 | timeCreated: 1493137621 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Generated/Input/Components.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd71b82187cad0e40848fcbe1a2569ef 3 | folderAsset: yes 4 | timeCreated: 1493137680 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Generated/Input/Components/InputLeftMouseComponent.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentContextGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public partial class InputContext { 10 | 11 | public InputEntity leftMouseEntity { get { return GetGroup(InputMatcher.LeftMouse).GetSingleEntity(); } } 12 | 13 | public bool isLeftMouse { 14 | get { return leftMouseEntity != null; } 15 | set { 16 | var entity = leftMouseEntity; 17 | if (value != (entity != null)) { 18 | if (value) { 19 | CreateEntity().isLeftMouse = true; 20 | } else { 21 | DestroyEntity(entity); 22 | } 23 | } 24 | } 25 | } 26 | } 27 | 28 | //------------------------------------------------------------------------------ 29 | // 30 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityGenerator. 31 | // 32 | // Changes to this file may cause incorrect behavior and will be lost if 33 | // the code is regenerated. 34 | // 35 | //------------------------------------------------------------------------------ 36 | public partial class InputEntity { 37 | 38 | static readonly LeftMouseComponent leftMouseComponent = new LeftMouseComponent(); 39 | 40 | public bool isLeftMouse { 41 | get { return HasComponent(InputComponentsLookup.LeftMouse); } 42 | set { 43 | if (value != isLeftMouse) { 44 | if (value) { 45 | AddComponent(InputComponentsLookup.LeftMouse, leftMouseComponent); 46 | } else { 47 | RemoveComponent(InputComponentsLookup.LeftMouse); 48 | } 49 | } 50 | } 51 | } 52 | } 53 | 54 | //------------------------------------------------------------------------------ 55 | // 56 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator. 57 | // 58 | // Changes to this file may cause incorrect behavior and will be lost if 59 | // the code is regenerated. 60 | // 61 | //------------------------------------------------------------------------------ 62 | public sealed partial class InputMatcher { 63 | 64 | static Entitas.IMatcher _matcherLeftMouse; 65 | 66 | public static Entitas.IMatcher LeftMouse { 67 | get { 68 | if (_matcherLeftMouse == null) { 69 | var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(InputComponentsLookup.LeftMouse); 70 | matcher.componentNames = InputComponentsLookup.componentNames; 71 | _matcherLeftMouse = matcher; 72 | } 73 | 74 | return _matcherLeftMouse; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Assets/Generated/Input/Components/InputLeftMouseComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce469210625fa5244bba3ac374402068 3 | timeCreated: 1493137681 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Input/Components/InputMouseDownComponent.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public partial class InputEntity { 10 | 11 | public MouseDownComponent mouseDown { get { return (MouseDownComponent)GetComponent(InputComponentsLookup.MouseDown); } } 12 | public bool hasMouseDown { get { return HasComponent(InputComponentsLookup.MouseDown); } } 13 | 14 | public void AddMouseDown(UnityEngine.Vector2 newPosition) { 15 | var index = InputComponentsLookup.MouseDown; 16 | var component = CreateComponent(index); 17 | component.position = newPosition; 18 | AddComponent(index, component); 19 | } 20 | 21 | public void ReplaceMouseDown(UnityEngine.Vector2 newPosition) { 22 | var index = InputComponentsLookup.MouseDown; 23 | var component = CreateComponent(index); 24 | component.position = newPosition; 25 | ReplaceComponent(index, component); 26 | } 27 | 28 | public void RemoveMouseDown() { 29 | RemoveComponent(InputComponentsLookup.MouseDown); 30 | } 31 | } 32 | 33 | //------------------------------------------------------------------------------ 34 | // 35 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator. 36 | // 37 | // Changes to this file may cause incorrect behavior and will be lost if 38 | // the code is regenerated. 39 | // 40 | //------------------------------------------------------------------------------ 41 | public sealed partial class InputMatcher { 42 | 43 | static Entitas.IMatcher _matcherMouseDown; 44 | 45 | public static Entitas.IMatcher MouseDown { 46 | get { 47 | if (_matcherMouseDown == null) { 48 | var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(InputComponentsLookup.MouseDown); 49 | matcher.componentNames = InputComponentsLookup.componentNames; 50 | _matcherMouseDown = matcher; 51 | } 52 | 53 | return _matcherMouseDown; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Assets/Generated/Input/Components/InputMouseDownComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40516e819ad13df42bed8b8335586207 3 | timeCreated: 1493137681 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Input/Components/InputMousePositionComponent.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public partial class InputEntity { 10 | 11 | public MousePositionComponent mousePosition { get { return (MousePositionComponent)GetComponent(InputComponentsLookup.MousePosition); } } 12 | public bool hasMousePosition { get { return HasComponent(InputComponentsLookup.MousePosition); } } 13 | 14 | public void AddMousePosition(UnityEngine.Vector2 newPosition) { 15 | var index = InputComponentsLookup.MousePosition; 16 | var component = CreateComponent(index); 17 | component.position = newPosition; 18 | AddComponent(index, component); 19 | } 20 | 21 | public void ReplaceMousePosition(UnityEngine.Vector2 newPosition) { 22 | var index = InputComponentsLookup.MousePosition; 23 | var component = CreateComponent(index); 24 | component.position = newPosition; 25 | ReplaceComponent(index, component); 26 | } 27 | 28 | public void RemoveMousePosition() { 29 | RemoveComponent(InputComponentsLookup.MousePosition); 30 | } 31 | } 32 | 33 | //------------------------------------------------------------------------------ 34 | // 35 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator. 36 | // 37 | // Changes to this file may cause incorrect behavior and will be lost if 38 | // the code is regenerated. 39 | // 40 | //------------------------------------------------------------------------------ 41 | public sealed partial class InputMatcher { 42 | 43 | static Entitas.IMatcher _matcherMousePosition; 44 | 45 | public static Entitas.IMatcher MousePosition { 46 | get { 47 | if (_matcherMousePosition == null) { 48 | var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(InputComponentsLookup.MousePosition); 49 | matcher.componentNames = InputComponentsLookup.componentNames; 50 | _matcherMousePosition = matcher; 51 | } 52 | 53 | return _matcherMousePosition; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Assets/Generated/Input/Components/InputMousePositionComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e8d8022effe31049b45b8dede44559d 3 | timeCreated: 1493137681 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Input/Components/InputMouseUpComponent.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public partial class InputEntity { 10 | 11 | public MouseUpComponent mouseUp { get { return (MouseUpComponent)GetComponent(InputComponentsLookup.MouseUp); } } 12 | public bool hasMouseUp { get { return HasComponent(InputComponentsLookup.MouseUp); } } 13 | 14 | public void AddMouseUp(UnityEngine.Vector2 newPosition) { 15 | var index = InputComponentsLookup.MouseUp; 16 | var component = CreateComponent(index); 17 | component.position = newPosition; 18 | AddComponent(index, component); 19 | } 20 | 21 | public void ReplaceMouseUp(UnityEngine.Vector2 newPosition) { 22 | var index = InputComponentsLookup.MouseUp; 23 | var component = CreateComponent(index); 24 | component.position = newPosition; 25 | ReplaceComponent(index, component); 26 | } 27 | 28 | public void RemoveMouseUp() { 29 | RemoveComponent(InputComponentsLookup.MouseUp); 30 | } 31 | } 32 | 33 | //------------------------------------------------------------------------------ 34 | // 35 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator. 36 | // 37 | // Changes to this file may cause incorrect behavior and will be lost if 38 | // the code is regenerated. 39 | // 40 | //------------------------------------------------------------------------------ 41 | public sealed partial class InputMatcher { 42 | 43 | static Entitas.IMatcher _matcherMouseUp; 44 | 45 | public static Entitas.IMatcher MouseUp { 46 | get { 47 | if (_matcherMouseUp == null) { 48 | var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(InputComponentsLookup.MouseUp); 49 | matcher.componentNames = InputComponentsLookup.componentNames; 50 | _matcherMouseUp = matcher; 51 | } 52 | 53 | return _matcherMouseUp; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Assets/Generated/Input/Components/InputMouseUpComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed7bf11199526c04987205dec698200b 3 | timeCreated: 1493137681 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Input/Components/InputRightMouseComponent.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentContextGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public partial class InputContext { 10 | 11 | public InputEntity rightMouseEntity { get { return GetGroup(InputMatcher.RightMouse).GetSingleEntity(); } } 12 | 13 | public bool isRightMouse { 14 | get { return rightMouseEntity != null; } 15 | set { 16 | var entity = rightMouseEntity; 17 | if (value != (entity != null)) { 18 | if (value) { 19 | CreateEntity().isRightMouse = true; 20 | } else { 21 | DestroyEntity(entity); 22 | } 23 | } 24 | } 25 | } 26 | } 27 | 28 | //------------------------------------------------------------------------------ 29 | // 30 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityGenerator. 31 | // 32 | // Changes to this file may cause incorrect behavior and will be lost if 33 | // the code is regenerated. 34 | // 35 | //------------------------------------------------------------------------------ 36 | public partial class InputEntity { 37 | 38 | static readonly RightMouseComponent rightMouseComponent = new RightMouseComponent(); 39 | 40 | public bool isRightMouse { 41 | get { return HasComponent(InputComponentsLookup.RightMouse); } 42 | set { 43 | if (value != isRightMouse) { 44 | if (value) { 45 | AddComponent(InputComponentsLookup.RightMouse, rightMouseComponent); 46 | } else { 47 | RemoveComponent(InputComponentsLookup.RightMouse); 48 | } 49 | } 50 | } 51 | } 52 | } 53 | 54 | //------------------------------------------------------------------------------ 55 | // 56 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator. 57 | // 58 | // Changes to this file may cause incorrect behavior and will be lost if 59 | // the code is regenerated. 60 | // 61 | //------------------------------------------------------------------------------ 62 | public sealed partial class InputMatcher { 63 | 64 | static Entitas.IMatcher _matcherRightMouse; 65 | 66 | public static Entitas.IMatcher RightMouse { 67 | get { 68 | if (_matcherRightMouse == null) { 69 | var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(InputComponentsLookup.RightMouse); 70 | matcher.componentNames = InputComponentsLookup.componentNames; 71 | _matcherRightMouse = matcher; 72 | } 73 | 74 | return _matcherRightMouse; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Assets/Generated/Input/Components/InputRightMouseComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4be37a78e6216344295b26a31f4d55c3 3 | timeCreated: 1493137681 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Input/InputAttribute.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ContextAttributeGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public sealed class InputAttribute : Entitas.CodeGeneration.Attributes.ContextAttribute { 10 | 11 | public InputAttribute() : base("Input") { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Assets/Generated/Input/InputAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 980e2f30c4e71c04da15a16dc8dbd953 3 | timeCreated: 1493137622 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Input/InputComponentsLookup.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ComponentsLookupGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public static class InputComponentsLookup { 10 | 11 | public const int LeftMouse = 0; 12 | public const int MouseDown = 1; 13 | public const int MousePosition = 2; 14 | public const int MouseUp = 3; 15 | public const int RightMouse = 4; 16 | 17 | public const int TotalComponents = 5; 18 | 19 | public static readonly string[] componentNames = { 20 | "LeftMouse", 21 | "MouseDown", 22 | "MousePosition", 23 | "MouseUp", 24 | "RightMouse" 25 | }; 26 | 27 | public static readonly System.Type[] componentTypes = { 28 | typeof(LeftMouseComponent), 29 | typeof(MouseDownComponent), 30 | typeof(MousePositionComponent), 31 | typeof(MouseUpComponent), 32 | typeof(RightMouseComponent) 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /Assets/Generated/Input/InputComponentsLookup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee2d1f138b524c04e97ec562180c2676 3 | timeCreated: 1493137622 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Input/InputContext.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ContextGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public sealed partial class InputContext : Entitas.Context { 10 | 11 | public InputContext() 12 | : base( 13 | InputComponentsLookup.TotalComponents, 14 | 0, 15 | new Entitas.ContextInfo( 16 | "Input", 17 | InputComponentsLookup.componentNames, 18 | InputComponentsLookup.componentTypes 19 | ), 20 | (entity) => 21 | 22 | #if (ENTITAS_FAST_AND_UNSAFE) 23 | new Entitas.UnsafeAERC() 24 | #else 25 | new Entitas.SafeAERC(entity) 26 | #endif 27 | 28 | ) { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Assets/Generated/Input/InputContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 06a97692372575648a430eeea230c79c 3 | timeCreated: 1493137622 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Input/InputEntity.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.EntityGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public sealed partial class InputEntity : Entitas.Entity { 10 | } 11 | -------------------------------------------------------------------------------- /Assets/Generated/Input/InputEntity.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26e20341b48aa954aa6b231cbb65934d 3 | timeCreated: 1493137622 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Generated/Input/InputMatcher.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by Entitas.CodeGeneration.Plugins.ContextMatcherGenerator. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | public sealed partial class InputMatcher { 10 | 11 | public static Entitas.IAllOfMatcher AllOf(params int[] indices) { 12 | return Entitas.Matcher.AllOf(indices); 13 | } 14 | 15 | public static Entitas.IAllOfMatcher AllOf(params Entitas.IMatcher[] matchers) { 16 | return Entitas.Matcher.AllOf(matchers); 17 | } 18 | 19 | public static Entitas.IAnyOfMatcher AnyOf(params int[] indices) { 20 | return Entitas.Matcher.AnyOf(indices); 21 | } 22 | 23 | public static Entitas.IAnyOfMatcher AnyOf(params Entitas.IMatcher[] matchers) { 24 | return Entitas.Matcher.AnyOf(matchers); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Assets/Generated/Input/InputMatcher.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c363dfb9ea35a9c4f87baff724a6caca 3 | timeCreated: 1493137622 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Libraries.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7e296239cf6f9d40bddf12d5e3e4572 3 | folderAsset: yes 4 | timeCreated: 1493132104 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 237eb1ad1d28eda4eba2d950881301dc 3 | folderAsset: yes 4 | timeCreated: 1493132306 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Compile.cs: -------------------------------------------------------------------------------- 1 | namespace Entitas.CodeGeneration.Unity.Editor { 2 | 3 | class Compile {} 4 | } 5 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Compile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fc07e0e0c8dd0344b0f173f28eadf50 3 | timeCreated: 1493132355 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f87dd3946c4577d498585ad862ec8779 3 | folderAsset: yes 4 | timeCreated: 1493132337 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.Blueprints.CodeGeneration.Plugins.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Entitas.Blueprints.CodeGeneration.Plugins.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.Blueprints.CodeGeneration.Plugins.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49087a1d9e4a32e4c9d7de9fd048075b 3 | timeCreated: 1493132342 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 0 14 | settings: {} 15 | Editor: 16 | enabled: 1 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.Blueprints.Unity.Editor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Entitas.Blueprints.Unity.Editor.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.Blueprints.Unity.Editor.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b304dc2f670093b44a18df0b476b1c22 3 | timeCreated: 1493132346 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 0 14 | settings: {} 15 | Editor: 16 | enabled: 1 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.CodeGeneration.CodeGenerator.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Entitas.CodeGeneration.CodeGenerator.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.CodeGeneration.CodeGenerator.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9f5463306186a8498b57ef31a48d987 3 | timeCreated: 1493132352 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 0 14 | settings: {} 15 | Editor: 16 | enabled: 1 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.CodeGeneration.Plugins.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Entitas.CodeGeneration.Plugins.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.CodeGeneration.Plugins.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef6a9c9f5fd471642b08dc8c9b5f8ea2 3 | timeCreated: 1493132352 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 0 14 | settings: {} 15 | Editor: 16 | enabled: 1 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.CodeGeneration.Unity.Editor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Entitas.CodeGeneration.Unity.Editor.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.CodeGeneration.Unity.Editor.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b344087b706465c4bbffca21e58fc8dc 3 | timeCreated: 1493132348 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 0 14 | settings: {} 15 | Editor: 16 | enabled: 1 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.CodeGeneration.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Entitas.CodeGeneration.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.CodeGeneration.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41483087f7edf284fa43228871311d62 3 | timeCreated: 1493132341 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 0 14 | settings: {} 15 | Editor: 16 | enabled: 1 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.Migration.Unity.Editor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Entitas.Migration.Unity.Editor.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.Migration.Unity.Editor.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95c0709f4ab94bb488469adc0e0aa6d7 3 | timeCreated: 1493132344 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 0 14 | settings: {} 15 | Editor: 16 | enabled: 1 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.Migration.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Entitas.Migration.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.Migration.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2dd90af41d0636c40914d74d5e5e74ac 3 | timeCreated: 1493132341 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 0 14 | settings: {} 15 | Editor: 16 | enabled: 1 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.Unity.Editor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Entitas.Unity.Editor.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.Unity.Editor.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04c9d46222b3b1a4bbd2b6b26f4074ed 3 | timeCreated: 1493132340 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 0 14 | settings: {} 15 | Editor: 16 | enabled: 1 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.VisualDebugging.CodeGeneration.Plugins.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Entitas.VisualDebugging.CodeGeneration.Plugins.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.VisualDebugging.CodeGeneration.Plugins.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc62d0cd9d6b0784cb3c5edf7af95c63 3 | timeCreated: 1493132353 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 0 14 | settings: {} 15 | Editor: 16 | enabled: 1 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.VisualDebugging.Unity.Editor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Entitas.VisualDebugging.Unity.Editor.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Entitas.VisualDebugging.Unity.Editor.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3c56aa8cf6d2674a8490b0116645c60 3 | timeCreated: 1493132350 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 0 14 | settings: {} 15 | Editor: 16 | enabled: 1 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b34a1afdc06abff45b958c1b9804102c 3 | folderAsset: yes 4 | timeCreated: 1493132337 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasContextErrorHierarchyIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Images/EntitasContextErrorHierarchyIcon.png -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasContextErrorHierarchyIcon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35e2fad360fea426684933179da777df 3 | labels: 4 | - EntitasContextErrorHierarchyIcon 5 | timeCreated: 1458954327 6 | licenseType: Pro 7 | TextureImporter: 8 | fileIDToRecycleName: {} 9 | serializedVersion: 4 10 | mipmaps: 11 | mipMapMode: 0 12 | enableMipMap: 0 13 | sRGBTexture: 1 14 | linearTexture: 0 15 | fadeOut: 0 16 | borderMipMap: 0 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 256 31 | textureSettings: 32 | filterMode: 0 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | compressionQuality: 50 39 | spriteMode: 0 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: 0.5, y: 0.5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaUsage: 1 47 | alphaIsTransparency: 1 48 | spriteTessellationDetail: -1 49 | textureType: 0 50 | textureShape: 1 51 | maxTextureSizeSet: 0 52 | compressionQualitySet: 0 53 | textureFormatSet: 0 54 | platformSettings: 55 | - buildTarget: DefaultTexturePlatform 56 | maxTextureSize: 256 57 | textureFormat: -1 58 | textureCompression: 0 59 | compressionQuality: 50 60 | crunchedCompression: 0 61 | allowsAlphaSplitting: 0 62 | overridden: 0 63 | - buildTarget: Standalone 64 | maxTextureSize: 256 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | - buildTarget: iPhone 72 | maxTextureSize: 256 73 | textureFormat: -1 74 | textureCompression: 0 75 | compressionQuality: 50 76 | crunchedCompression: 0 77 | allowsAlphaSplitting: 0 78 | overridden: 0 79 | - buildTarget: Android 80 | maxTextureSize: 256 81 | textureFormat: -1 82 | textureCompression: 0 83 | compressionQuality: 50 84 | crunchedCompression: 0 85 | allowsAlphaSplitting: 0 86 | overridden: 0 87 | - buildTarget: WebGL 88 | maxTextureSize: 256 89 | textureFormat: -1 90 | textureCompression: 0 91 | compressionQuality: 50 92 | crunchedCompression: 0 93 | allowsAlphaSplitting: 0 94 | overridden: 0 95 | spriteSheet: 96 | serializedVersion: 2 97 | sprites: [] 98 | outline: [] 99 | spritePackingTag: 100 | userData: 101 | assetBundleName: 102 | assetBundleVariant: 103 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasContextHierarchyIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Images/EntitasContextHierarchyIcon.png -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasContextHierarchyIcon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e23ad41464ef945d784cdb90d844e6c4 3 | labels: 4 | - EntitasContextHierarchyIcon 5 | timeCreated: 1457898659 6 | licenseType: Pro 7 | TextureImporter: 8 | fileIDToRecycleName: {} 9 | serializedVersion: 4 10 | mipmaps: 11 | mipMapMode: 0 12 | enableMipMap: 0 13 | sRGBTexture: 1 14 | linearTexture: 0 15 | fadeOut: 0 16 | borderMipMap: 0 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 256 31 | textureSettings: 32 | filterMode: 0 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | compressionQuality: 50 39 | spriteMode: 0 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: 0.5, y: 0.5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaUsage: 1 47 | alphaIsTransparency: 1 48 | spriteTessellationDetail: -1 49 | textureType: 0 50 | textureShape: 1 51 | maxTextureSizeSet: 0 52 | compressionQualitySet: 0 53 | textureFormatSet: 0 54 | platformSettings: 55 | - buildTarget: DefaultTexturePlatform 56 | maxTextureSize: 256 57 | textureFormat: -1 58 | textureCompression: 0 59 | compressionQuality: 50 60 | crunchedCompression: 0 61 | allowsAlphaSplitting: 0 62 | overridden: 0 63 | - buildTarget: Standalone 64 | maxTextureSize: 256 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | - buildTarget: iPhone 72 | maxTextureSize: 256 73 | textureFormat: -1 74 | textureCompression: 0 75 | compressionQuality: 50 76 | crunchedCompression: 0 77 | allowsAlphaSplitting: 0 78 | overridden: 0 79 | - buildTarget: Android 80 | maxTextureSize: 256 81 | textureFormat: -1 82 | textureCompression: 0 83 | compressionQuality: 50 84 | crunchedCompression: 0 85 | allowsAlphaSplitting: 0 86 | overridden: 0 87 | - buildTarget: WebGL 88 | maxTextureSize: 256 89 | textureFormat: -1 90 | textureCompression: 0 91 | compressionQuality: 50 92 | crunchedCompression: 0 93 | allowsAlphaSplitting: 0 94 | overridden: 0 95 | spriteSheet: 96 | serializedVersion: 2 97 | sprites: [] 98 | outline: [] 99 | spritePackingTag: 100 | userData: 101 | assetBundleName: 102 | assetBundleVariant: 103 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasEntityErrorHierarchyIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Images/EntitasEntityErrorHierarchyIcon.png -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasEntityErrorHierarchyIcon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 06bc0e5b0b5124fca8f5d7dde1d012b0 3 | labels: 4 | - EntitasEntityErrorHierarchyIcon 5 | timeCreated: 1461325930 6 | licenseType: Pro 7 | TextureImporter: 8 | fileIDToRecycleName: {} 9 | serializedVersion: 4 10 | mipmaps: 11 | mipMapMode: 0 12 | enableMipMap: 0 13 | sRGBTexture: 1 14 | linearTexture: 0 15 | fadeOut: 0 16 | borderMipMap: 0 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 256 31 | textureSettings: 32 | filterMode: 0 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | compressionQuality: 50 39 | spriteMode: 0 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: 0.5, y: 0.5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaUsage: 1 47 | alphaIsTransparency: 1 48 | spriteTessellationDetail: -1 49 | textureType: 0 50 | textureShape: 1 51 | maxTextureSizeSet: 0 52 | compressionQualitySet: 0 53 | textureFormatSet: 0 54 | platformSettings: 55 | - buildTarget: DefaultTexturePlatform 56 | maxTextureSize: 256 57 | textureFormat: -1 58 | textureCompression: 0 59 | compressionQuality: 50 60 | crunchedCompression: 0 61 | allowsAlphaSplitting: 0 62 | overridden: 0 63 | - buildTarget: Standalone 64 | maxTextureSize: 256 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | spriteSheet: 72 | serializedVersion: 2 73 | sprites: [] 74 | outline: [] 75 | spritePackingTag: 76 | userData: 77 | assetBundleName: 78 | assetBundleVariant: 79 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasEntityHierarchyIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Images/EntitasEntityHierarchyIcon.png -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasEntityHierarchyIcon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27b806265ee874b86aa2d28aba93ace2 3 | labels: 4 | - EntitasEntityHierarchyIcon 5 | timeCreated: 1457898659 6 | licenseType: Pro 7 | TextureImporter: 8 | fileIDToRecycleName: {} 9 | serializedVersion: 4 10 | mipmaps: 11 | mipMapMode: 0 12 | enableMipMap: 0 13 | sRGBTexture: 1 14 | linearTexture: 0 15 | fadeOut: 0 16 | borderMipMap: 0 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 256 31 | textureSettings: 32 | filterMode: 0 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | compressionQuality: 50 39 | spriteMode: 0 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: 0.5, y: 0.5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaUsage: 1 47 | alphaIsTransparency: 1 48 | spriteTessellationDetail: -1 49 | textureType: 0 50 | textureShape: 1 51 | maxTextureSizeSet: 0 52 | compressionQualitySet: 0 53 | textureFormatSet: 0 54 | platformSettings: 55 | - buildTarget: DefaultTexturePlatform 56 | maxTextureSize: 256 57 | textureFormat: -1 58 | textureCompression: 0 59 | compressionQuality: 50 60 | crunchedCompression: 0 61 | allowsAlphaSplitting: 0 62 | overridden: 0 63 | - buildTarget: Standalone 64 | maxTextureSize: 256 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | spriteSheet: 72 | serializedVersion: 2 73 | sprites: [] 74 | outline: [] 75 | spritePackingTag: 76 | userData: 77 | assetBundleName: 78 | assetBundleVariant: 79 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasHeader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Images/EntitasHeader.png -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasHeader.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65fb57b88da1f40c59682763366ab260 3 | labels: 4 | - EntitasHeader 5 | timeCreated: 1488042330 6 | licenseType: Pro 7 | TextureImporter: 8 | fileIDToRecycleName: {} 9 | serializedVersion: 4 10 | mipmaps: 11 | mipMapMode: 0 12 | enableMipMap: 0 13 | sRGBTexture: 1 14 | linearTexture: 0 15 | fadeOut: 0 16 | borderMipMap: 0 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: 2 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | compressionQuality: 50 39 | spriteMode: 0 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: 0.5, y: 0.5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaUsage: 1 47 | alphaIsTransparency: 0 48 | spriteTessellationDetail: -1 49 | textureType: 0 50 | textureShape: 1 51 | maxTextureSizeSet: 0 52 | compressionQualitySet: 0 53 | textureFormatSet: 0 54 | platformSettings: 55 | - buildTarget: DefaultTexturePlatform 56 | maxTextureSize: 2048 57 | textureFormat: -1 58 | textureCompression: 0 59 | compressionQuality: 50 60 | crunchedCompression: 0 61 | allowsAlphaSplitting: 0 62 | overridden: 0 63 | - buildTarget: Standalone 64 | maxTextureSize: 2048 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | spriteSheet: 72 | serializedVersion: 2 73 | sprites: [] 74 | outline: [] 75 | spritePackingTag: 76 | userData: 77 | assetBundleName: 78 | assetBundleVariant: 79 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasSystemsErrorHierarchyIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Images/EntitasSystemsErrorHierarchyIcon.png -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasSystemsErrorHierarchyIcon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8fecc08fe51ec4ba990bfd58e4ed14b5 3 | labels: 4 | - EntitasSystemsErrorHierarchyIcon 5 | timeCreated: 1489846920 6 | licenseType: Pro 7 | TextureImporter: 8 | fileIDToRecycleName: {} 9 | serializedVersion: 4 10 | mipmaps: 11 | mipMapMode: 0 12 | enableMipMap: 0 13 | sRGBTexture: 1 14 | linearTexture: 0 15 | fadeOut: 0 16 | borderMipMap: 0 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: 0 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | compressionQuality: 50 39 | spriteMode: 0 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: 0.5, y: 0.5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaUsage: 1 47 | alphaIsTransparency: 1 48 | spriteTessellationDetail: -1 49 | textureType: 0 50 | textureShape: 1 51 | maxTextureSizeSet: 0 52 | compressionQualitySet: 0 53 | textureFormatSet: 0 54 | platformSettings: 55 | - buildTarget: DefaultTexturePlatform 56 | maxTextureSize: 256 57 | textureFormat: -1 58 | textureCompression: 0 59 | compressionQuality: 50 60 | crunchedCompression: 0 61 | allowsAlphaSplitting: 0 62 | overridden: 0 63 | - buildTarget: Standalone 64 | maxTextureSize: 256 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | spriteSheet: 72 | serializedVersion: 2 73 | sprites: [] 74 | outline: [] 75 | spritePackingTag: 76 | userData: 77 | assetBundleName: 78 | assetBundleVariant: 79 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasSystemsHierarchyIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Editor/Images/EntitasSystemsHierarchyIcon.png -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Editor/Images/EntitasSystemsHierarchyIcon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ee737a83aa9b4b56b2058b2b651ff0a 3 | labels: 4 | - EntitasSystemsHierarchyIcon 5 | timeCreated: 1489847588 6 | licenseType: Pro 7 | TextureImporter: 8 | fileIDToRecycleName: {} 9 | serializedVersion: 4 10 | mipmaps: 11 | mipMapMode: 0 12 | enableMipMap: 0 13 | sRGBTexture: 1 14 | linearTexture: 0 15 | fadeOut: 0 16 | borderMipMap: 0 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 256 31 | textureSettings: 32 | filterMode: 0 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | compressionQuality: 50 39 | spriteMode: 0 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: 0.5, y: 0.5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaUsage: 1 47 | alphaIsTransparency: 1 48 | spriteTessellationDetail: -1 49 | textureType: 0 50 | textureShape: 1 51 | maxTextureSizeSet: 0 52 | compressionQualitySet: 0 53 | textureFormatSet: 0 54 | platformSettings: 55 | - buildTarget: DefaultTexturePlatform 56 | maxTextureSize: 256 57 | textureFormat: -1 58 | textureCompression: 0 59 | compressionQuality: 50 60 | crunchedCompression: 0 61 | allowsAlphaSplitting: 0 62 | overridden: 0 63 | - buildTarget: Standalone 64 | maxTextureSize: 256 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | spriteSheet: 72 | serializedVersion: 2 73 | sprites: [] 74 | outline: [] 75 | spritePackingTag: 76 | userData: 77 | assetBundleName: 78 | assetBundleVariant: 79 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.Blueprints.Unity.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Entitas.Blueprints.Unity.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.Blueprints.Unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d160ef8bf11a3eb42a3f01c559e55176 3 | timeCreated: 1493132351 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 1 14 | settings: {} 15 | Editor: 16 | enabled: 0 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.Blueprints.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Entitas.Blueprints.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.Blueprints.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53ab760c60f8c804996fcfa71b7120f0 3 | timeCreated: 1493132343 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 1 14 | settings: {} 15 | Editor: 16 | enabled: 0 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.CodeGeneration.Attributes.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Entitas.CodeGeneration.Attributes.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.CodeGeneration.Attributes.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9356d707a5187c40a4e52becccff982 3 | timeCreated: 1493132351 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 1 14 | settings: {} 15 | Editor: 16 | enabled: 0 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.Unity.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Entitas.Unity.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.Unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3c8855f5e024d346a4f503212917aba 3 | timeCreated: 1493132348 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 1 14 | settings: {} 15 | Editor: 16 | enabled: 0 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.Utils.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Entitas.Utils.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.Utils.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98ecfcaf04b2a584b9c6e38c9d9ed8e8 3 | timeCreated: 1493132344 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 1 14 | settings: {} 15 | Editor: 16 | enabled: 0 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.VisualDebugging.Unity.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Entitas.VisualDebugging.Unity.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.VisualDebugging.Unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4620699b32603064984abe3ee5209c1f 3 | timeCreated: 1493132342 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 1 14 | settings: {} 15 | Editor: 16 | enabled: 0 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/Entitas.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/Entitas.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08a1b4b45b8a34441a48a1a44d1dd028 3 | timeCreated: 1493132341 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 1 14 | settings: {} 15 | Editor: 16 | enabled: 0 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/fabl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Libraries/Enititas/fabl.dll -------------------------------------------------------------------------------- /Assets/Libraries/Enititas/fabl.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a18aa917bf61c2c47afbbc8f8cf5d356 3 | timeCreated: 1493132345 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | Any: 13 | enabled: 1 14 | settings: {} 15 | Editor: 16 | enabled: 0 17 | settings: 18 | DefaultValueInitialized: true 19 | WindowsStoreApps: 20 | enabled: 0 21 | settings: 22 | CPU: AnyCPU 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cebe05fed959a14789041cb46950583 3 | folderAsset: yes 4 | timeCreated: 1493132367 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Bee.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Resources/Bee.psd -------------------------------------------------------------------------------- /Assets/Resources/Bee.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80e6c66cf870db544aa417ef7961ba57 3 | timeCreated: 1493132429 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 1000 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: tvOS 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 1 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: Android 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | - buildTarget: Tizen 94 | maxTextureSize: 2048 95 | textureFormat: -1 96 | textureCompression: 1 97 | compressionQuality: 50 98 | crunchedCompression: 0 99 | allowsAlphaSplitting: 0 100 | overridden: 0 101 | - buildTarget: Windows Store Apps 102 | maxTextureSize: 2048 103 | textureFormat: -1 104 | textureCompression: 1 105 | compressionQuality: 50 106 | crunchedCompression: 0 107 | allowsAlphaSplitting: 0 108 | overridden: 0 109 | - buildTarget: WebGL 110 | maxTextureSize: 2048 111 | textureFormat: -1 112 | textureCompression: 1 113 | compressionQuality: 50 114 | crunchedCompression: 0 115 | allowsAlphaSplitting: 0 116 | overridden: 0 117 | - buildTarget: Samsung TV 118 | maxTextureSize: 2048 119 | textureFormat: -1 120 | textureCompression: 1 121 | compressionQuality: 50 122 | crunchedCompression: 0 123 | allowsAlphaSplitting: 0 124 | overridden: 0 125 | spriteSheet: 126 | serializedVersion: 2 127 | sprites: [] 128 | outline: [] 129 | spritePackingTag: 130 | userData: 131 | assetBundleName: 132 | assetBundleVariant: 133 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74a62ef789dc46948825dd6f6892b349 3 | folderAsset: yes 4 | timeCreated: 1493132653 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/GameScene.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Assets/Scenes/GameScene.unity -------------------------------------------------------------------------------- /Assets/Scenes/GameScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c62de9f366be734d83f951930e40bf0 3 | timeCreated: 1493132653 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/StreamingAssets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 63693695d9db3474da5e18db3822acd9 3 | folderAsset: yes 4 | timeCreated: 1493137607 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Entitas.properties: -------------------------------------------------------------------------------- 1 | Entitas.CodeGeneration.CodeGenerator.SearchPaths = Assets/Libraries/Entitas, Assets/Libraries/Entitas/Editor, /Applications/Unity/Unity.app/Contents/Managed, /Applications/Unity/Unity.app/Contents/Mono/lib/mono/unity, /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem 2 | Entitas.CodeGeneration.CodeGenerator.Plugins = Entitas.CodeGeneration.Plugins, Entitas.VisualDebugging.CodeGeneration.Plugins, Entitas.Blueprints.CodeGeneration.Plugins 3 | Entitas.CodeGeneration.CodeGenerator.DataProviders = Entitas.Blueprints.CodeGeneration.Plugins.BlueprintDataProvider, Entitas.CodeGeneration.Plugins.ComponentDataProvider, Entitas.CodeGeneration.Plugins.ContextDataProvider, Entitas.CodeGeneration.Plugins.EntityIndexDataProvider 4 | Entitas.CodeGeneration.CodeGenerator.CodeGenerators = Entitas.Blueprints.CodeGeneration.Plugins.BlueprintsGenerator, Entitas.CodeGeneration.Plugins.ComponentContextGenerator, Entitas.CodeGeneration.Plugins.ComponentEntityGenerator, Entitas.CodeGeneration.Plugins.ComponentGenerator, Entitas.CodeGeneration.Plugins.ComponentMatcherGenerator, Entitas.CodeGeneration.Plugins.ComponentsLookupGenerator, Entitas.CodeGeneration.Plugins.ContextAttributeGenerator, Entitas.CodeGeneration.Plugins.ContextGenerator, Entitas.CodeGeneration.Plugins.ContextMatcherGenerator, Entitas.CodeGeneration.Plugins.ContextsGenerator, Entitas.CodeGeneration.Plugins.EntityGenerator, Entitas.CodeGeneration.Plugins.EntityIndexGenerator, Entitas.VisualDebugging.CodeGeneration.Plugins.ContextObserverGenerator, Entitas.VisualDebugging.CodeGeneration.Plugins.FeatureClassGenerator 5 | Entitas.CodeGeneration.CodeGenerator.PostProcessors = Entitas.CodeGeneration.Plugins.AddFileHeaderPostProcessor, Entitas.CodeGeneration.Plugins.CleanTargetDirectoryPostProcessor, Entitas.CodeGeneration.Plugins.MergeFilesPostProcessor, Entitas.CodeGeneration.Plugins.NewLinePostProcessor, Entitas.CodeGeneration.Plugins.UpdateCSProjPostProcessor, Entitas.CodeGeneration.Plugins.WriteToDiskPostProcessor, Entitas.CodeGeneration.Plugins.ConsoleWriteLinePostProcessor 6 | Entitas.VisualDebugging.Unity.Editor.SystemWarningThreshold = 1 7 | Entitas.VisualDebugging.Unity.Editor.DefaultInstanceCreatorFolderPath = Assets/Editor/DefaultInstanceCreator 8 | Entitas.VisualDebugging.Unity.Editor.TypeDrawerFolderPath = Assets/Editor/TypeDrawer 9 | Entitas.CodeGeneration.Plugins.Assemblies = Library/ScriptAssemblies/Assembly-CSharp.dll 10 | Entitas.CodeGeneration.Plugins.Contexts = Game, Input 11 | Entitas.CodeGeneration.Plugins.IgnoreNamespaces = false 12 | Entitas.CodeGeneration.Plugins.TargetDirectory = Assets/Generated/ 13 | Entitas.CodeGeneration.Plugins.ProjectPath = Entitas - Simple Movement.csproj 14 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.5.0f3 2 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NOTE: 2 | Some API changes have been made since this tutorial was written. Most notably, the return type of GetTrigger methods has switched to use the interface `ICollector` instead of the base class `Collector` and the entity-link method no longer has a `Contexts` argument. The code in the repo is no longer maintained but the readme will stay up to date helping you quickly fix errors when you download the project. 3 | 4 | # Introduction 5 | 6 | This tutorial you will show how to represent game state in Entitas (as components) and how to render that game state using Unity functionality (via systems). You'll also see how to pass Unity user-input into components that other systems can react to and carry out related game logic. Finally you'll implement a very simple AI system that allows entities to carry out movement commands issued by mouse clicks. 7 | 8 | The finished tutorial project can be found [here](https://github.com/FNGgames/Entitas-Simple-Movement-Unity-Example). 9 | 10 | # Prerequisite 11 | 12 | If you are brand new to Entitas, you should make sure to go over the [Hello World](https://github.com/sschmid/Entitas-CSharp/wiki/Unity-Tutorial-Hello-World) tutorial before you attempt this one. 13 | 14 | To start we will need to have a new empty Unity project setup for 2D with the latest version of Entitas installed and configured. If you don't know how to do this then please check out [[this guide|Using-Entitas-with-Unity]] for detailed step-by-step instructions on how to do that before continuing. 15 | 16 | # Step 1 - Setup Folders 17 | 18 | Create a new folder called "Game Code" and inside it create two additional folders called "Components" and "Systems". This is where we will store our created components and systems respectively. 19 | 20 | # Step 2 - Components 21 | 22 | To represent entity position in space we'll need a `PositionComponent` (we're in 2D so we'll use a Vector2 to store the position). We're also going to represent the entity's direction as a degree value, so we'll need a float `DirectionComponent`. 23 | 24 | *Components.cs* 25 | ```csharp 26 | using Entitas; 27 | using Entitas.CodeGeneration.Attributes; 28 | using UnityEngine; 29 | 30 | [Game] 31 | public class PositionComponent : IComponent 32 | { 33 | public Vector2 value; 34 | } 35 | 36 | [Game] 37 | public class DirectionComponent : IComponent 38 | { 39 | public float value; 40 | } 41 | ``` 42 | 43 | We will also want to render our entities to screen. We'll do this with Unity's **SpriteRenderer**, but we will also need a Unity **GameObject** to hold the SpriteRenderer. We'll need two more components, a `ViewComponent` for the GameObject and a `SpriteComponent` which will store the name of the sprite we want to display. 44 | 45 | *Components.cs (contd)* 46 | ```csharp 47 | [Game] 48 | public class ViewComponent : IComponent 49 | { 50 | public GameObject gameObject; 51 | } 52 | 53 | [Game] 54 | public class SpriteComponent : IComponent 55 | { 56 | public string name; 57 | } 58 | ``` 59 | 60 | We're going to move some of our entities, so we'll create a flag component to indicate entities that can move ("movers"). We'll also need a component to hold the movement target location and another flag to indicate that the movement has completed successfully. 61 | 62 | *Components.cs (contd)* 63 | ```csharp 64 | [Game] 65 | public class MoverComponent : IComponent 66 | { 67 | } 68 | 69 | [Game] 70 | public class MoveComponent : IComponent 71 | { 72 | public Vector2 target; 73 | } 74 | 75 | [Game] 76 | public class MoveCompleteComponent : IComponent 77 | { 78 | } 79 | ``` 80 | 81 | Finally we have the components from the Input context. We are expecting user input from the mouse, so we'll create components to store the mouse position that we will read from Unity's **Input** class. We want to distinguish between mouse down, mouse up, and mouse pressed (i.e. neither up nor down). We'll also want to distinguish the left from the right mouse buttons. There is only one left mouse button, so we can make use of the **Unique** attribute. 82 | 83 | *Components.cs (contd)* 84 | ```csharp 85 | [Input, Unique] 86 | public class LeftMouseComponent : IComponent 87 | { 88 | } 89 | 90 | [Input, Unique] 91 | public class RightMouseComponent : IComponent 92 | { 93 | } 94 | 95 | [Input] 96 | public class MouseDownComponent : IComponent 97 | { 98 | public Vector2 position; 99 | } 100 | 101 | [Input] 102 | public class MousePositionComponent : IComponent 103 | { 104 | public Vector2 position; 105 | } 106 | 107 | [Input] 108 | public class MouseUpComponent : IComponent 109 | { 110 | public Vector2 position; 111 | } 112 | ``` 113 | 114 | You can save all of these Component definitions in a single file to keep the project simple and organized. In the finished project it is called `Components.cs`. Return to Unity and allow the code to compile. When compiled, hit **Generate** to generate the supporting files for your components. Now we can begin to use those components in our systems. 115 | 116 | # Step 3 - View Systems 117 | 118 | We need to communicate the game state to the player. We will do this through a series of **ReactiveSystems** that serve to bridge the gap between the underlying state and the visual representation in Unity. **SpriteComponents** provide us a link to a particular asset to render to the screen. We will render it using Unity's **SpriteRenderer** class. This requires that we also generate **GameObjects** to hold the SpriteRenderers. This brings us to our first two systems: 119 | 120 | ## AddViewSystem 121 | 122 | The purpose of this system is to identify entities that have a `SpriteComponent` but have not yet been given an associated **GameObject**. We therefore react on the addition of a `SpriteComponent` and filter for `!ViewComponent`. When the system is constructed, we will also create a parent **GameObject** to hold all of the child views. When we create a GameObject we set its parent then we use Entitas' `EntityLink` functionality to create a link between the GameObject and the entity that it belongs to. You'll see the effect of this linking if you open up your Unity hierarchy while running the game - the GameObject's inspector pane will show the entity it represents and all of its components right there in the inspector. 123 | 124 | *AddViewSystem.cs* 125 | ```csharp 126 | using System.Collections.Generic; 127 | using Entitas; 128 | using Entitas.Unity; 129 | using UnityEngine; 130 | 131 | public class AddViewSystem : ReactiveSystem 132 | { 133 | readonly Transform _viewContainer = new GameObject("Game Views").transform; 134 | readonly GameContext _context; 135 | 136 | public AddViewSystem(Contexts contexts) : base(contexts.game) 137 | { 138 | _context = contexts.game; 139 | } 140 | 141 | protected override ICollector GetTrigger(IContext context) 142 | { 143 | return context.CreateCollector(GameMatcher.Sprite); 144 | } 145 | 146 | protected override bool Filter(GameEntity entity) 147 | { 148 | return entity.hasSprite && !entity.hasView; 149 | } 150 | 151 | protected override void Execute(List entities) 152 | { 153 | foreach (GameEntity e in entities) 154 | { 155 | GameObject go = new GameObject("Game View"); 156 | go.transform.SetParent(_viewContainer, false); 157 | e.AddView(go); 158 | go.Link(e); 159 | } 160 | } 161 | } 162 | ``` 163 | 164 | **Note:** Older versions of this tutorial called `go.Link` with `_contexts` as the second argument (i.e. `go.Link(e, _contexts)`). This is no longer necessary, nor possible. 165 | 166 | ## RenderSpriteSystem 167 | 168 | With the GameObjects in place, we can handle the sprites. This system reacts to the `SpriteComponent` being added, just as the above one does, only this time we filter for only those entities that *have* already had a `ViewComponent` added. If the entity has a `ViewComponent` we know it also has a **GameObject** which we can access and add or replace it's **SpriteRenderer**. 169 | 170 | *RenderSpriteSystem.cs* 171 | ```csharp 172 | using System.Collections.Generic; 173 | using Entitas; 174 | using UnityEngine; 175 | 176 | public class RenderSpriteSystem : ReactiveSystem 177 | { 178 | public RenderSpriteSystem(Contexts contexts) : base(contexts.game) 179 | { 180 | } 181 | 182 | protected override ICollector GetTrigger(IContext context) 183 | { 184 | return context.CreateCollector(GameMatcher.Sprite); 185 | } 186 | 187 | protected override bool Filter(GameEntity entity) 188 | { 189 | return entity.hasSprite && entity.hasView; 190 | } 191 | 192 | protected override void Execute(List entities) 193 | { 194 | foreach (GameEntity e in entities) 195 | { 196 | GameObject go = e.view.gameObject; 197 | SpriteRenderer sr = go.GetComponent(); 198 | if (sr == null) sr = go.AddComponent(); 199 | sr.sprite = Resources.Load(e.sprite.name); 200 | } 201 | } 202 | } 203 | ``` 204 | 205 | ## RenderPositionSystem 206 | 207 | Next we want to make sure the position of the **GameObject** is the same as the value of `PositionComponent`. To do this we create a system that reacts to `PositionComponent`. We check in the filter that the entity also has a `ViewComponent`, since we will need to access its GameObject to move it. 208 | 209 | *RenderPositionSystem.cs* 210 | ```csharp 211 | using System.Collections.Generic; 212 | using Entitas; 213 | 214 | public class RenderPositionSystem : ReactiveSystem 215 | { 216 | public RenderPositionSystem(Contexts contexts) : base(contexts.game) 217 | { 218 | } 219 | 220 | protected override ICollector GetTrigger(IContext context) 221 | { 222 | return context.CreateCollector(GameMatcher.Position); 223 | } 224 | 225 | protected override bool Filter(GameEntity entity) 226 | { 227 | return entity.hasPosition && entity.hasView; 228 | } 229 | 230 | protected override void Execute(List entities) 231 | { 232 | foreach (GameEntity e in entities) 233 | { 234 | e.view.gameObject.transform.position = e.position.value; 235 | } 236 | } 237 | } 238 | ``` 239 | 240 | ## RenderDirectionSystem 241 | 242 | Finally we want to rotate the **GameObject** to reflect the value of the `DirectionComponent` of an entity. In this case we react to `DirectionComponent` and filter for `entity.hasView`. The code within the execute block is a simple method of converting degree angles to **Quaternion** rotations which can be applied to Unity GameObject **Transforms**. 243 | 244 | *RenderDirectionSystem.cs* 245 | ```csharp 246 | using System.Collections.Generic; 247 | using Entitas; 248 | using UnityEngine; 249 | 250 | public class RenderDirectionSystem : ReactiveSystem 251 | { 252 | readonly GameContext _context; 253 | 254 | public RenderDirectionSystem(Contexts contexts) : base(contexts.game) 255 | { 256 | _context = contexts.game; 257 | } 258 | 259 | protected override ICollector GetTrigger(IContext context) 260 | { 261 | return context.CreateCollector(GameMatcher.Direction); 262 | } 263 | 264 | protected override bool Filter(GameEntity entity) 265 | { 266 | return entity.hasDirection && entity.hasView; 267 | } 268 | 269 | protected override void Execute(List entities) 270 | { 271 | foreach (GameEntity e in entities) 272 | { 273 | float ang = e.direction.value; 274 | e.view.gameObject.transform.rotation = Quaternion.AngleAxis(ang - 90, Vector3.forward); 275 | } 276 | } 277 | } 278 | ``` 279 | 280 | ## ViewSystems (Feature) 281 | 282 | We will now put all of these systems inside a **Feature** for organization. This will give use better visual debugging of the systems in the inspector, and simplify our GameController. 283 | 284 | *ViewSystems.cs* 285 | ```csharp 286 | using Entitas; 287 | 288 | public class ViewSystems : Feature 289 | { 290 | public ViewSystems(Contexts contexts) : base("View Systems") 291 | { 292 | Add(new AddViewSystem(contexts)); 293 | Add(new RenderSpriteSystem(contexts)); 294 | Add(new RenderPositionSystem(contexts)); 295 | Add(new RenderDirectionSystem(contexts)); 296 | } 297 | } 298 | ``` 299 | 300 | # Step 4 - Movement Systems 301 | 302 | We will now write a simple system to get AI entities to move to supplied target locations automatically. The desired behaviour is that the entity will turn to face the supplied movement target and then move towards it at a constant speed. When it reaches the target it should stop, and it's movement order should be removed. 303 | 304 | We will achieve this with an Execute system that runs every frame. We can keep an up to date list of all the **GameEntities** that have a `MoveComponent` using the Group functionality. We'll set this up in the constructor then keep a read-only reference to the group in the system for later use. We can get the list of entities by calling `group.GetEntities()`. 305 | 306 | The `Execute()` method will take every entity with a `PositionComponent` and a `MoveComponent` and adjust it's position by a fixed amount in the direction of its move target. If the entity is within range of the target, the move is considered complete. We use the `MoveCompleteComponent` as a flag to show that the movement was completed by actually reaching a target, to distinguish it from entities that have had their `MoveComponent` removed for other reasons (like to change target or simply to cancel the movement prematurely). We should also change the direction of the entity such that it faces its target. We therefore calculate the angle to the target in this system too. 307 | 308 | We will also clean up all the `MoveCompleteComponent`s during the cleanup phase of the system (which runs after every system has finished its execute phase). The cleanup part ensures that `MoveCompleteComponent` only flags entities that have completed their movement within one frame and not ones who finished a long time ago and who are waiting for new movement commands. 309 | 310 | ## MovementSystem 311 | 312 | *MoveSystem.cs* 313 | ```csharp 314 | using Entitas; 315 | using UnityEngine; 316 | 317 | public class MoveSystem : IExecuteSystem, ICleanupSystem 318 | { 319 | readonly IGroup _moves; 320 | readonly IGroup _moveCompletes; 321 | const float _speed = 4f; 322 | 323 | public MoveSystem(Contexts contexts) 324 | { 325 | _moves = contexts.game.GetGroup(GameMatcher.Move); 326 | _moveCompletes = contexts.game.GetGroup(GameMatcher.MoveComplete); 327 | } 328 | 329 | public void Execute() 330 | { 331 | foreach (GameEntity e in _moves.GetEntities()) 332 | { 333 | Vector2 dir = e.move.target - e.position.value; 334 | Vector2 newPosition = e.position.value + dir.normalized * _speed * Time.deltaTime; 335 | e.ReplacePosition(newPosition); 336 | 337 | float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg; 338 | e.ReplaceDirection(angle); 339 | 340 | float dist = dir.magnitude; 341 | if (dist <= 0.5f) 342 | { 343 | e.RemoveMove(); 344 | e.isMoveComplete = true; 345 | } 346 | } 347 | } 348 | 349 | public void Cleanup() 350 | { 351 | foreach (GameEntity e in _moveCompletes.GetEntities()) 352 | { 353 | e.isMoveComplete = false; 354 | } 355 | } 356 | } 357 | ``` 358 | 359 | ## MovementSystems (feature) 360 | 361 | The feature that holds the above system will be called "MovementSystems": 362 | 363 | *MovementSystems.cs* (feature) 364 | ```csharp 365 | public class MovementSystems : Feature 366 | { 367 | public MovementSystems(Contexts contexts) : base("Movement Systems") 368 | { 369 | Add(new MoveSystem(contexts)); 370 | } 371 | } 372 | ``` 373 | 374 | # Step 5 - Input Systems 375 | 376 | Our goal is to allow the user to create AI agents with a right mouse click and command them to move using the left mouse click. We're going to introduce a way to push mouse input from unity into Entitas in a flexible way that allows multiple systems to interact with the mouse input in different ways. Unity provides three distinct mouse button states for each button (i.e. `GetMouseButtonDown()`, `GetMouseButtonUp()` and `GetMouseButton()`). We have defined components for each of these events `MouseDownComponent`, `MouseUpComponent`, and `MousePositionComponent`. Our goal is to push data from Unity to our components so we can use them with Entitas systems. 377 | 378 | We have also defined two *unique* flag components, one for left mouse button and one for right mouse button. Since they are marked as unique we can access them directly from the context. By calling `_inputContext.isLeftMouse = true` we can create a unique entity for the left mouse button. Just like any other entity, we can add or remove other component to them. Because they are *unique* we can access these entities using `_inputcontext.leftMouseEntity` and `_inputcontext.rightMouseEntity`. Both of these entities can then carry one of each of the three mouse components, up, down and position. 379 | 380 | 381 | ## EmitInputSystem 382 | 383 | This is an execute system which polls Unity's `Input` class each frame and replaces components on the unique left and right mouse button entities when the corresponding buttons are pressed. We will use the **Initialize** phase of the system to set up the two unique entities and the **Execute** phase to set their components. 384 | 385 | *EmitInputSystem.cs* 386 | 387 | ```csharp 388 | using Entitas; 389 | using UnityEngine; 390 | 391 | public class EmitInputSystem : IInitializeSystem, IExecuteSystem 392 | { 393 | readonly InputContext _context; 394 | private InputEntity _leftMouseEntity; 395 | private InputEntity _rightMouseEntity; 396 | 397 | public EmitInputSystem(Contexts contexts) 398 | { 399 | _context = contexts.input; 400 | } 401 | 402 | public void Initialize() 403 | { 404 | // initialize the unique entities that will hold the mouse button data 405 | _context.isLeftMouse = true; 406 | _leftMouseEntity = _context.leftMouseEntity; 407 | 408 | _context.isRightMouse = true; 409 | _rightMouseEntity = _context.rightMouseEntity; 410 | } 411 | 412 | public void Execute() 413 | { 414 | // mouse position 415 | Vector2 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition); 416 | 417 | // left mouse button 418 | if (Input.GetMouseButtonDown(0)) 419 | _leftMouseEntity.ReplaceMouseDown(mousePosition); 420 | 421 | if (Input.GetMouseButton(0)) 422 | _leftMouseEntity.ReplaceMousePosition(mousePosition); 423 | 424 | if (Input.GetMouseButtonUp(0)) 425 | _leftMouseEntity.ReplaceMouseUp(mousePosition); 426 | 427 | 428 | // right mouse button 429 | if (Input.GetMouseButtonDown(1)) 430 | _rightMouseEntity.ReplaceMouseDown(mousePosition); 431 | 432 | if (Input.GetMouseButton(1)) 433 | _rightMouseEntity.ReplaceMousePosition(mousePosition); 434 | 435 | if (Input.GetMouseButtonUp(1)) 436 | _rightMouseEntity.ReplaceMouseUp(mousePosition); 437 | 438 | } 439 | } 440 | ``` 441 | 442 | ## CreateMoverSystem 443 | 444 | We'll need some "movers" to carry out the movement. These will be entities that carry the "Mover" flag component, a `PositionComponent`, a `DirectionComponent` and will be displayed on screen with a `SpriteComponent`. The sprite in the complete project is called "Bee". Feel free to replace this with a sprite of your own as you follow along. 445 | 446 | This system will react to the right mouse button being clicked. For this we want the collector to match all of `RightMouseComponent` and `MouseDownComponent`. Remember, these get set in the `EmitInputSystem` when the user presses the right mouse button down. 447 | 448 | *CreateMoverSystem.cs* 449 | ```csharp 450 | using System.Collections.Generic; 451 | using Entitas; 452 | using UnityEngine; 453 | 454 | public class CreateMoverSystem : ReactiveSystem 455 | { 456 | readonly GameContext _gameContext; 457 | public CreateMoverSystem(Contexts contexts) : base(contexts.input) 458 | { 459 | _gameContext = contexts.game; 460 | } 461 | 462 | protected override ICollector GetTrigger(IContext context) 463 | { 464 | return context.CreateCollector(InputMatcher.AllOf(InputMatcher.RightMouse, InputMatcher.MouseDown)); 465 | } 466 | 467 | protected override bool Filter(InputEntity entity) 468 | { 469 | return entity.hasMouseDown; 470 | } 471 | 472 | protected override void Execute(List entities) 473 | { 474 | foreach (InputEntity e in entities) 475 | { 476 | GameEntity mover = _gameContext.CreateEntity(); 477 | mover.isMover = true; 478 | mover.AddPosition(e.mouseDown.position); 479 | mover.AddDirection(Random.Range(0,360)); 480 | mover.AddSprite("Bee"); 481 | } 482 | } 483 | } 484 | ``` 485 | 486 | ## CommandMoveSystem 487 | 488 | We also need to be able to assign movement orders to our movers. To do this we'll react on left mouse button presses just as we reacted to right mouse button presses above. On execute we'll search the group of Movers who don't already have a movement order. To configure a group in this way we use `GetGroup(GameMatcher.AllOf(GameMatcher.Mover).NoneOf(GameMatcher.Move))`. That is all of the entities that are flagged as "Mover" that do not also have a `MoveComponent` attached. 489 | 490 | *CommandMoveSystem.cs* 491 | ```csharp 492 | using System.Collections.Generic; 493 | using Entitas; 494 | using UnityEngine; 495 | 496 | public class CommandMoveSystem : ReactiveSystem 497 | { 498 | readonly GameContext _gameContext; 499 | readonly IGroup _movers; 500 | 501 | public CommandMoveSystem(Contexts contexts) : base(contexts.input) 502 | { 503 | _movers = contexts.game.GetGroup(GameMatcher.AllOf(GameMatcher.Mover).NoneOf(GameMatcher.Move)); 504 | } 505 | 506 | protected override ICollector GetTrigger(IContext context) 507 | { 508 | return context.CreateCollector(InputMatcher.AllOf(InputMatcher.LeftMouse, InputMatcher.MouseDown)); 509 | } 510 | 511 | protected override bool Filter(InputEntity entity) 512 | { 513 | return entity.hasMouseDown; 514 | } 515 | 516 | protected override void Execute(List entities) 517 | { 518 | foreach (InputEntity e in entities) 519 | { 520 | GameEntity[] movers = _movers.GetEntities(); 521 | if (movers.Length <= 0) return; 522 | movers[Random.Range(0, movers.Length)].ReplaceMove(e.mouseDown.position); 523 | } 524 | } 525 | } 526 | ``` 527 | 528 | ## InputSystems (feature) 529 | 530 | The feature that holds the above two systems will be called "InputSystems": 531 | 532 | *InputSystems.cs* 533 | ```csharp 534 | using Entitas; 535 | 536 | public class InputSystems : Feature 537 | { 538 | public InputSystems(Contexts contexts) : base("Input Systems") 539 | { 540 | Add(new EmitInputSystem(contexts)); 541 | Add(new CreateMoverSystem(contexts)); 542 | Add(new CommandMoveSystem(contexts)); 543 | } 544 | } 545 | ``` 546 | 547 | # Step 6 - Game Controller 548 | 549 | Now we need to create the game controller to initialise and activate the game. The concept of the GameController should be familiar to you by now, but if not please re-visit [Hello World](https://github.com/sschmid/Entitas-CSharp/wiki/Unity-Tutorial-Hello-World) to get a description. Once this script has been saved, create an empty game object in your unity heirarchy and attach this script to it. 550 | 551 | You may need to adjust your sprite import settings, and camera settings to get the sprites to look the way you want them to look on screen. By default, the code loads "Bee" sprite from the `Assets/Resources` folder. The finished example project sets the camera's orthographic size to 10 and the background to solid grey. Your sprite should also face vertically up so as to make sure the direction is properly rendered. 552 | 553 | *GameController.cs* 554 | ```csharp 555 | using Entitas; 556 | using UnityEngine; 557 | 558 | public class GameController : MonoBehaviour 559 | { 560 | private Systems _systems; 561 | private Contexts _contexts; 562 | 563 | void Start() 564 | { 565 | _contexts = Contexts.sharedInstance; 566 | _systems = CreateSystems(_contexts); 567 | _systems.Initialize(); 568 | } 569 | 570 | void Update() 571 | { 572 | _systems.Execute(); 573 | _systems.Cleanup(); 574 | } 575 | 576 | private static Systems CreateSystems(Contexts contexts) 577 | { 578 | return new Feature("Systems") 579 | .Add(new InputSystems(contexts)) 580 | .Add(new MovementSystems(contexts)) 581 | .Add(new ViewSystems(contexts)); 582 | } 583 | } 584 | ``` 585 | 586 | # Step 7 - Run the game 587 | 588 | Save, compile and run your game from the Unity editor. Right-clicking on the screen should create objects displaying your sprite at the position on the screen which you clicked. Left clicking should send them moving towards the position on the screen which you clicked. Notice their direction updating to aim them towards their target point. When they reach the target position they will stop moving and again become available for movement assignments. 589 | -------------------------------------------------------------------------------- /Screenshots/Preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FNGgames/Entitas-Simple-Movement-Unity-Example/8ded8ada11627f8e90b187b369b48b42a861c9fe/Screenshots/Preferences.png --------------------------------------------------------------------------------