├── Assets ├── Unit Control │ ├── Circle.png │ ├── New Terrain.asset │ ├── UnitSelectedComponent.cs │ ├── SelectCircleComponent.cs │ ├── Unit Control.unity.meta │ ├── PrefabGameObject.prefab.meta │ ├── SelectCircleInitializerComponent.cs │ ├── New Terrain.asset.meta │ ├── SelectedCircle.mat.meta │ ├── SelectionArea.mat.meta │ ├── MoveComponent.cs.meta │ ├── SceneController.cs.meta │ ├── UnitMoveSystem.cs.meta │ ├── SelectCircleComponent.cs.meta │ ├── UnitControlSystem.cs.meta │ ├── UnitSelectedComponent.cs.meta │ ├── UnitSelectedRenderer.cs.meta │ ├── SelectCircleInitializerComponent.cs.meta │ ├── MoveComponent.cs │ ├── SceneController.cs │ ├── UnitSelectedRenderer.cs │ ├── UnitMoveSystem.cs │ ├── SelectionArea.mat │ ├── SelectedCircle.mat │ ├── Circle.png.meta │ ├── UnitControlSystem.cs │ └── PrefabGameObject.prefab ├── ECS + Job │ ├── pngfind.com-sprite-logo-png-2398144.png │ ├── ECS + Job.unity.meta │ ├── SpriteMat.mat.meta │ ├── MoveSpeedComponent.cs │ ├── MoveSystem.cs.meta │ ├── TestController.cs.meta │ ├── MoveSpeedComponent.cs.meta │ ├── MoveSystem.cs │ ├── TestController.cs │ ├── SpriteMat.mat │ └── pngfind.com-sprite-logo-png-2398144.png.meta ├── Jobs │ ├── Jobs.unity.meta │ ├── TestController.cs.meta │ └── TestController.cs ├── Boids.meta ├── Boids │ ├── Art Assets │ │ ├── TornadoBanditsStudio │ │ │ ├── Low Poly Background Bird │ │ │ │ ├── Meshes │ │ │ │ │ ├── Bird.FBX │ │ │ │ │ └── Bird.FBX.meta │ │ │ │ ├── Sprites │ │ │ │ │ ├── Clouds.psd │ │ │ │ │ └── Clouds.psd.meta │ │ │ │ ├── Docs │ │ │ │ │ ├── Documentation.pdf │ │ │ │ │ └── Documentation.pdf.meta │ │ │ │ ├── Materials │ │ │ │ │ ├── TrailMaterial.mat.meta │ │ │ │ │ ├── RectangularTrail.mat.meta │ │ │ │ │ ├── BoidMat 1.mat.meta │ │ │ │ │ ├── BlackBird_Colorscheme.mat.meta │ │ │ │ │ ├── WhiteBird_Colorscheme.mat.meta │ │ │ │ │ ├── EmissiveBird_Colorscheme.mat.meta │ │ │ │ │ ├── WhiteBird_Colorscheme.mat │ │ │ │ │ ├── TrailMaterial.mat │ │ │ │ │ ├── RectangularTrail.mat │ │ │ │ │ ├── BoidMat 1.mat │ │ │ │ │ ├── EmissiveBird_Colorscheme.mat │ │ │ │ │ └── BlackBird_Colorscheme.mat │ │ │ │ ├── Textures │ │ │ │ │ ├── GlowTexture.png │ │ │ │ │ ├── SquareGlowTexture.png │ │ │ │ │ ├── BlackBird_Colorscheme.png │ │ │ │ │ ├── WhiteBird_Colorscheme.png │ │ │ │ │ ├── BlackBird_Colorscheme.png.meta │ │ │ │ │ ├── WhiteBird_Colorscheme.png.meta │ │ │ │ │ ├── GlowTexture.png.meta │ │ │ │ │ └── SquareGlowTexture.png.meta │ │ │ │ ├── Prefabs │ │ │ │ │ ├── Bird_Black.prefab.meta │ │ │ │ │ ├── Bird_Trail.prefab.meta │ │ │ │ │ ├── Bird_White.prefab.meta │ │ │ │ │ ├── Bird_WhiteEmissive.prefab.meta │ │ │ │ │ └── Bird_WhiteEmissive_Trail.prefab.meta │ │ │ │ ├── DemoScenes │ │ │ │ │ ├── Birds_Day_Scene.unity.meta │ │ │ │ │ ├── Birds_Night_Scene.unity.meta │ │ │ │ │ ├── Layout_Bird_Assets.unity.meta │ │ │ │ │ ├── PostProcessingDay.asset.meta │ │ │ │ │ ├── PostProcessingNight.asset.meta │ │ │ │ │ ├── PostProcessingDay.asset │ │ │ │ │ └── PostProcessingNight.asset │ │ │ │ ├── Docs.meta │ │ │ │ ├── Skyboxes │ │ │ │ │ ├── Skybox_Bird_Day.mat.meta │ │ │ │ │ ├── Skybox_Bird_Night.mat.meta │ │ │ │ │ ├── Skybox_Bird_Night.mat │ │ │ │ │ └── Skybox_Bird_Day.mat │ │ │ │ ├── Materials.meta │ │ │ │ ├── Meshes.meta │ │ │ │ ├── Prefabs.meta │ │ │ │ ├── Scripts.meta │ │ │ │ ├── Skyboxes.meta │ │ │ │ ├── Sprites.meta │ │ │ │ ├── Textures.meta │ │ │ │ ├── DemoScenes.meta │ │ │ │ └── Scripts │ │ │ │ │ ├── Bird.cs.meta │ │ │ │ │ ├── FlockManager.cs.meta │ │ │ │ │ ├── FlockManager.cs │ │ │ │ │ └── Bird.cs │ │ │ └── Low Poly Background Bird.meta │ │ └── TornadoBanditsStudio.meta │ ├── 1)GameObjects │ │ ├── Classic.unity.meta │ │ ├── Boid.prefab.meta │ │ ├── Boid.cs.meta │ │ ├── BoidsManager.cs.meta │ │ ├── BoidsManager.cs │ │ └── Boid.cs │ ├── 2)ECS+Jobs │ │ ├── ECS+Jobs.unity.meta │ │ ├── Boid.prefab.meta │ │ ├── Boid.cs.meta │ │ ├── BoidPrefabComponent.cs │ │ ├── BoidSystem.cs.meta │ │ ├── BoidSpawnSystem.cs.meta │ │ ├── BoidPrefabAuthoring.cs.meta │ │ ├── BoidPrefabComponent.cs.meta │ │ ├── Boid.cs │ │ ├── BoidPrefabAuthoring.cs │ │ ├── BoidSpawnSystem.cs │ │ └── BoidSystem.cs │ ├── 2)ECS+Jobs.meta │ ├── Art Assets.meta │ └── 1)GameObjects.meta ├── Jobs.meta ├── Utils.meta ├── ECS + Job.meta ├── Unit Control.meta ├── PrefabToEntity.meta ├── PrefabToEntity │ ├── PrefabGameObject.prefab.meta │ ├── PrefabToEntity.unity.meta │ ├── EntitiesSpawnerSystem.cs.meta │ ├── PrefabEntityAuthoring.cs.meta │ ├── PrefabEntityComponent.cs.meta │ ├── PrefabEntityComponent.cs │ ├── PrefabEntityAuthoring.cs │ ├── EntitiesSpawnerSystem.cs │ └── PrefabGameObject.prefab └── Utils │ ├── MousePositionUtils.cs.meta │ └── MousePositionUtils.cs ├── ProjectSettings ├── ProjectVersion.txt ├── ClusterInputManager.asset ├── PresetManager.asset ├── EditorBuildSettings.asset ├── XRSettings.asset ├── VersionControlSettings.asset ├── TimeManager.asset ├── VFXManager.asset ├── AudioManager.asset ├── TagManager.asset ├── UnityConnectSettings.asset ├── EditorSettings.asset ├── PackageManagerSettings.asset ├── DynamicsManager.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── GraphicsSettings.asset ├── SceneTemplateSettings.json ├── InputManager.asset └── QualitySettings.asset ├── .vsconfig ├── .gitignore ├── UserSettings └── EditorUserSettings.asset └── Packages └── manifest.json /Assets/Unit Control/Circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moecia/UnityECS/HEAD/Assets/Unit Control/Circle.png -------------------------------------------------------------------------------- /Assets/Unit Control/New Terrain.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moecia/UnityECS/HEAD/Assets/Unit Control/New Terrain.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2020.3.10f1 2 | m_EditorVersionWithRevision: 2020.3.10f1 (297d780c91bc) 3 | -------------------------------------------------------------------------------- /.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Assets/ECS + Job/pngfind.com-sprite-logo-png-2398144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moecia/UnityECS/HEAD/Assets/ECS + Job/pngfind.com-sprite-logo-png-2398144.png -------------------------------------------------------------------------------- /Assets/Unit Control/UnitSelectedComponent.cs: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | 3 | namespace UnitControl 4 | { 5 | public struct UnitSelectedComponent : IComponentData { } 6 | } 7 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /Assets/Jobs/Jobs.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4bd8296298ea43646962b5e0b9a8bc58 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /Assets/Unit Control/SelectCircleComponent.cs: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | 3 | namespace UnitControl 4 | { 5 | [GenerateAuthoringComponent] 6 | public struct SelectCircleComponent : IComponentData { } 7 | } 8 | -------------------------------------------------------------------------------- /Assets/Boids.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4899540a3b6322948943b8d97d67b9d2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Meshes/Bird.FBX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moecia/UnityECS/HEAD/Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Meshes/Bird.FBX -------------------------------------------------------------------------------- /Assets/ECS + Job/ECS + Job.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Jobs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 872b316eb4f5f9a4d97194bde86ea415 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 252de6a4b844028408cb72bc1b5a3aaf 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/1)GameObjects/Classic.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: feadc3311149069488a69fe8b6989c58 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Boids/2)ECS+Jobs/ECS+Jobs.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e8ccb1f6f8911943b62f67261ce6dd5 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Sprites/Clouds.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moecia/UnityECS/HEAD/Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Sprites/Clouds.psd -------------------------------------------------------------------------------- /Assets/ECS + Job.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4126a16d27f3dc64baba33a3dd79703b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unit Control.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb2a54a05e953f849829a21d40fe0798 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unit Control/Unit Control.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25b4d4ba16e1d944dbd34b8329d9f0a2 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Boids/2)ECS+Jobs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13da0e22d3519d94ca18f10d7f436d12 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd8ff834ca81027408a3dd6ac30de1bb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PrefabToEntity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32a7c001466c91d4aaab13bf43fbe3dd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PrefabToEntity/PrefabGameObject.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9dd96b200ba52a44865155a987d090a 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/PrefabToEntity/PrefabToEntity.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71adfbff2e65f1747b169758dafdfea6 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Unit Control/PrefabGameObject.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43084fdea987cee4c84a5f55e4e8eaea 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /Assets/Boids/1)GameObjects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c06ab46330274aa45b663b17b48c9c46 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Docs/Documentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moecia/UnityECS/HEAD/Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Docs/Documentation.pdf -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Materials/TrailMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c10b1630d5621ec48a17223c3c102023 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Unit Control/SelectCircleInitializerComponent.cs: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | 3 | namespace UnitControl 4 | { 5 | [GenerateAuthoringComponent] 6 | public struct SelectCircleInitializerComponent : IComponentData { } 7 | } 8 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Materials/RectangularTrail.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f76d0134347ae984a85f25ebd0097b2e 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Textures/GlowTexture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moecia/UnityECS/HEAD/Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Textures/GlowTexture.png -------------------------------------------------------------------------------- /Assets/Boids/2)ECS+Jobs/Boid.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd7c2521f674933499f45c74840f9e96 3 | timeCreated: 1500635951 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd679e71790b764489bb150587987ee8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Textures/SquareGlowTexture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moecia/UnityECS/HEAD/Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Textures/SquareGlowTexture.png -------------------------------------------------------------------------------- /Assets/Boids/1)GameObjects/Boid.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 161cb63f7e271724a9dd0c0d13062968 3 | timeCreated: 1500635951 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ECS + Job/SpriteMat.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d8cc0763c5088745a531f3fb15f009c 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Textures/BlackBird_Colorscheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moecia/UnityECS/HEAD/Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Textures/BlackBird_Colorscheme.png -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Textures/WhiteBird_Colorscheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moecia/UnityECS/HEAD/Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Textures/WhiteBird_Colorscheme.png -------------------------------------------------------------------------------- /Assets/ECS + Job/MoveSpeedComponent.cs: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | 3 | namespace EcsSample 4 | { 5 | [GenerateAuthoringComponent] 6 | public struct MoveSpeedComponent : IComponentData 7 | { 8 | public float MoveSpeed; 9 | } 10 | } -------------------------------------------------------------------------------- /Assets/Unit Control/New Terrain.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8235082e9d2cde4292d23839a73e617 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 15600000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unit Control/SelectedCircle.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09cb8a5b4fbee594aa14a99a296957fc 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Unit Control/SelectionArea.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1187bc86585f0d744a13633661e3fd7e 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Docs/Documentation.pdf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab4d8569c277e6b45bce88fb749eaba8 3 | timeCreated: 1500764568 4 | licenseType: Store 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eaa7cbec86c44ab42ab4a7ae6a745f15 3 | folderAsset: yes 4 | timeCreated: 1500576663 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Materials/BoidMat 1.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cecaead6076bc6f46aa761f6bbbf79fe 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Prefabs/Bird_Black.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 973ae5cbed0c84542bc811aeeba5125e 3 | timeCreated: 1500582302 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Prefabs/Bird_Trail.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 936047101d8ea6d4fa5b8e38d7513266 3 | timeCreated: 1500756456 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Prefabs/Bird_White.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a33e1f4ce2d78c04bb569f11d5cb5c3a 3 | timeCreated: 1500582378 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/DemoScenes/Birds_Day_Scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12b8e8674c4870544a09b87ac153011f 3 | timeCreated: 1500576663 4 | licenseType: Store 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/DemoScenes/Birds_Night_Scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ecd105d775c1ef49b575abff344d3da 3 | timeCreated: 1500576663 4 | licenseType: Store 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/DemoScenes/Layout_Bird_Assets.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 622be908e7fb79f4da25384991e7221c 3 | timeCreated: 1500692821 4 | licenseType: Store 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Docs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dce76de8e1b894e41b6e8113d5a467d1 3 | folderAsset: yes 4 | timeCreated: 1500764468 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Skyboxes/Skybox_Bird_Day.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bf55c2c2bc7894408bbb61f001197b5 3 | timeCreated: 1500591345 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Skyboxes/Skybox_Bird_Night.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 38a4516fd6a6676458fcc9e066a0f93d 3 | timeCreated: 1500591345 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/DemoScenes/PostProcessingDay.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a3822ab2f5365547a51ba494fed59a6 3 | timeCreated: 1500692106 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99a99faf8c124b6438324c3685634dd4 3 | folderAsset: yes 4 | timeCreated: 1500581644 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Materials/BlackBird_Colorscheme.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ed1dec24b365994d8eb6e20481ff581 3 | timeCreated: 1500581644 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Materials/WhiteBird_Colorscheme.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1d805cd8d1d46440a76eba05349cded 3 | timeCreated: 1500582331 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Meshes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6ba2d09efc27ff40afd857611fe157a 3 | folderAsset: yes 4 | timeCreated: 1500576666 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6dc609855c0920545b94f7572b4bae93 3 | folderAsset: yes 4 | timeCreated: 1500576666 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Prefabs/Bird_WhiteEmissive.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9322510dd49e7b649a9141424d342278 3 | timeCreated: 1500635951 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc5a1e69ea090c1418738de2e2db0856 3 | folderAsset: yes 4 | timeCreated: 1500636014 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Skyboxes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e46609110ce795e40911f493536a7543 3 | folderAsset: yes 4 | timeCreated: 1500591312 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 170802827ce7d7849abc373618850958 3 | folderAsset: yes 4 | timeCreated: 1500591753 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 932c346d5b2ae804f85f5ba283d8a750 3 | folderAsset: yes 4 | timeCreated: 1500576666 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/DemoScenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58fa8d23c0ec133439761d7a23becbd7 3 | folderAsset: yes 4 | timeCreated: 1500576663 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/DemoScenes/PostProcessingNight.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f59e28fcb5edbe54b831d8d496b4e62c 3 | timeCreated: 1500676084 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Materials/EmissiveBird_Colorscheme.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d807e17b7fd2214bb558ab527ccb803 3 | timeCreated: 1500592076 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Prefabs/Bird_WhiteEmissive_Trail.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1cb3684535613e4086e0cd8c9c0dba9 3 | timeCreated: 1500756440 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Jobs/TestController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c191e2e4a60bfd148b20cfffb5d6b460 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Boids/1)GameObjects/Boid.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ccdecd267307f64189617da0ccb6a75 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Boids/2)ECS+Jobs/Boid.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f009b9d5af94ddc4988eff1e65d35b41 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Boids/2)ECS+Jobs/BoidPrefabComponent.cs: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | 3 | namespace Boid.ECS 4 | { 5 | [GenerateAuthoringComponent] 6 | public struct BoidPrefabComponent : IComponentData 7 | { 8 | public Entity BoidPrefab; 9 | public int Count; 10 | public int CageSize; 11 | } 12 | } -------------------------------------------------------------------------------- /Assets/ECS + Job/MoveSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d96d22ec7fea26c4f8a7321ba0f7fe49 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ECS + Job/TestController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f256115b2221d9542bdb2018a37b9bc2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Utils/MousePositionUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93c03fdea0835ef40883a75f99d77310 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Boids/2)ECS+Jobs/BoidSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a37c5d507d1bde6408e75130a2b8c092 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ECS + Job/MoveSpeedComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d9e1262416763b49bf2e1d174965bf0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unit Control/MoveComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 848b76eb86649cc499a3a9ec4e631cd6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unit Control/SceneController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8decad9c05c2fe246a96ddffb13521a0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unit Control/UnitMoveSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c838009dfd441904aa296cacbf96ee0f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Boids/1)GameObjects/BoidsManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 402048416986b044eb22c17db3461db0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Boids/2)ECS+Jobs/BoidSpawnSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3627ffa8ca219b24a9047b47b4cd5ab6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unit Control/SelectCircleComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4af4e930556ff044cb5ac3ae8092a195 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unit Control/UnitControlSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 350b01eb2b5fc57458a35cd71b655be7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unit Control/UnitSelectedComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 38ded85cce308f945acf0ed675806d09 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unit Control/UnitSelectedRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8020428e10b384479bfbf20cb5f20bf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Boids/2)ECS+Jobs/BoidPrefabAuthoring.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db2d0e673126e8e4c9a6fc623894717b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Boids/2)ECS+Jobs/BoidPrefabComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a50509533ce44b64eb874599d49f945e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/PrefabToEntity/EntitiesSpawnerSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75fc81927d2a6334abed0ef216b4ef51 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/PrefabToEntity/PrefabEntityAuthoring.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a52d219733a4c04db66c62472d9ddb6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/PrefabToEntity/PrefabEntityComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7851e0f5eb1b2814dafa089bfd00209b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Unit Control/SelectCircleInitializerComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48884bc91064b784ab424fa47fa3764e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /Assets/PrefabToEntity/PrefabEntityComponent.cs: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | 3 | namespace PrefabToEntity 4 | { 5 | public struct PrefabEntityComponent : IComponentData 6 | { 7 | public Entity PrefabEntity; 8 | public int Count; 9 | public SpawnAxis SpawnAxis; 10 | } 11 | 12 | public enum SpawnAxis 13 | { 14 | XY, 15 | XZ 16 | } 17 | } -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Scripts/Bird.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab4dd536d263b234b947c5d167063ea2 3 | timeCreated: 1500636004 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Scripts/FlockManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1efd734a372683646bf7770f751a1352 3 | timeCreated: 1500636393 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Unit Control/MoveComponent.cs: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | using Unity.Mathematics; 3 | using UnityEngine; 4 | 5 | namespace UnitControl 6 | { 7 | [GenerateAuthoringComponent] 8 | public struct MoveComponent : IComponentData 9 | { 10 | [HideInInspector] public bool IsMoving; 11 | [HideInInspector] public float3 TargetPosition; 12 | [HideInInspector] public float3 LastMoveDirection; 13 | public float MoveSpeed; 14 | } 15 | } -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /Assets/Boids/2)ECS+Jobs/Boid.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using Unity.Entities; 4 | using UnityEngine; 5 | 6 | namespace Boid.ECS 7 | { 8 | [GenerateAuthoringComponent] 9 | public struct Boid : IComponentData 10 | { 11 | public float CellRadius; 12 | public float SeparationWeight; 13 | public float AlighmentWeight; 14 | public float CohesionWeight; 15 | public float MoveSpeed; 16 | public float AvoidWallsWeight; 17 | public float AvoidWallTurnDistance; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - Level 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Assets/Unit Control/SceneController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnitControl 6 | { 7 | public class SceneController : MonoBehaviour 8 | { 9 | public static SceneController Instance; 10 | public Transform SelectionArea; 11 | 12 | private void Awake() 13 | { 14 | Instance = this; 15 | } 16 | 17 | public void SetSelectionAreaPosition(Vector3 position) 18 | { 19 | SelectionArea.position = new Vector3(position.x, SelectionArea.position.y, position.z); 20 | } 21 | 22 | public void SetSelectionAreaScale(Vector3 scale) 23 | { 24 | SelectionArea.localScale = new Vector3(scale.x, 0, scale.z); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Materials/WhiteBird_Colorscheme.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: WhiteBird_Colorscheme 10 | m_Shader: {fileID: 10703, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: b9fafa1f014545c47a16e562586e3c00, type: 3} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | m_Floats: [] 25 | m_Colors: [] 26 | -------------------------------------------------------------------------------- /Assets/ECS + Job/MoveSystem.cs: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | using Unity.Mathematics; 3 | using Unity.Transforms; 4 | 5 | namespace EcsSample 6 | { 7 | public class MoveSystem : SystemBase 8 | { 9 | protected override void OnUpdate() 10 | { 11 | var dt = Time.DeltaTime; 12 | Entities.ForEach((ref Translation translation, ref MoveSpeedComponent moveSpeedComponent) => 13 | { 14 | translation.Value.y += moveSpeedComponent.MoveSpeed * dt; 15 | if (translation.Value.y > 5f) 16 | { 17 | moveSpeedComponent.MoveSpeed = -math.abs(moveSpeedComponent.MoveSpeed); 18 | } 19 | else if (translation.Value.y < -5f) 20 | { 21 | moveSpeedComponent.MoveSpeed = math.abs(moveSpeedComponent.MoveSpeed); 22 | } 23 | }).ScheduleParallel(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Assets/Unit Control/UnitSelectedRenderer.cs: -------------------------------------------------------------------------------- 1 | using Unity.Collections; 2 | using Unity.Entities; 3 | using Unity.Mathematics; 4 | using Unity.Rendering; 5 | using Unity.Transforms; 6 | using UnityEngine; 7 | 8 | namespace UnitControl 9 | { 10 | public class UnitSelectedRenderer : SystemBase 11 | { 12 | protected override void OnUpdate() 13 | { 14 | var ecb = new EntityCommandBuffer(Allocator.TempJob); 15 | 16 | Entities 17 | .WithAll() 18 | .ForEach((Entity entity, in Parent parent) => 19 | { 20 | if (HasComponent(parent.Value)) 21 | { 22 | ecb.AddComponent(entity); 23 | ecb.AddComponent(entity); 24 | } 25 | }).Run(); 26 | 27 | ecb.Playback(EntityManager); 28 | ecb.Dispose(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/Boids/2)ECS+Jobs/BoidPrefabAuthoring.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Unity.Entities; 3 | using UnityEngine; 4 | 5 | namespace Boid.ECS 6 | { 7 | public class BoidPrefabAuthoring : MonoBehaviour, IDeclareReferencedPrefabs, IConvertGameObjectToEntity 8 | { 9 | public GameObject BoidPrefab; 10 | public int Count; 11 | public int CageSize; 12 | 13 | public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem) 14 | { 15 | var spawnerData = new BoidPrefabComponent 16 | { 17 | BoidPrefab = conversionSystem.GetPrimaryEntity(BoidPrefab), 18 | Count = Count, 19 | CageSize = CageSize 20 | }; 21 | dstManager.AddComponentData(entity, spawnerData); 22 | } 23 | 24 | public void DeclareReferencedPrefabs(List referencedPrefabs) 25 | { 26 | referencedPrefabs.Add(BoidPrefab); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Assets/PrefabToEntity/PrefabEntityAuthoring.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Unity.Entities; 3 | using UnityEngine; 4 | 5 | namespace PrefabToEntity 6 | { 7 | public class PrefabEntityAuthoring : MonoBehaviour, IDeclareReferencedPrefabs, IConvertGameObjectToEntity 8 | { 9 | public GameObject Prefab; 10 | public int Count; 11 | public SpawnAxis SpawnAxis; 12 | 13 | public void DeclareReferencedPrefabs(List referencedPrefabs) 14 | { 15 | referencedPrefabs.Add(Prefab); 16 | } 17 | 18 | public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem) 19 | { 20 | var spawnerData = new PrefabEntityComponent 21 | { 22 | PrefabEntity = conversionSystem.GetPrimaryEntity(Prefab), 23 | Count = Count, 24 | SpawnAxis = SpawnAxis 25 | }; 26 | dstManager.AddComponentData(entity, spawnerData); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | UnityAdsSettings: 27 | m_Enabled: 0 28 | m_InitializeOnStartup: 1 29 | m_TestMode: 0 30 | m_IosGameId: 31 | m_AndroidGameId: 32 | m_GameIds: {} 33 | m_GameId: 34 | PerformanceReportingSettings: 35 | m_Enabled: 0 36 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Materials/TrailMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: TrailMaterial 10 | m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: 01d037806d2e199459b3fa81fe5a3c6a, type: 3} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | m_Floats: 25 | - first: 26 | name: _InvFade 27 | second: 1.85 28 | m_Colors: 29 | - first: 30 | name: _Color 31 | second: {r: 1, g: 1, b: 1, a: 1} 32 | - first: 33 | name: _TintColor 34 | second: {r: 1, g: 1, b: 1, a: 0.5019608} 35 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Materials/RectangularTrail.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: RectangularTrail 10 | m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: 8c4242f3bbb2a124ba965ff11436eddb, type: 3} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | m_Floats: 25 | - first: 26 | name: _InvFade 27 | second: 1.85 28 | m_Colors: 29 | - first: 30 | name: _Color 31 | second: {r: 1, g: 1, b: 1, a: 1} 32 | - first: 33 | name: _TintColor 34 | second: {r: 1, g: 1, b: 1, a: 0.5019608} 35 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /Assets/Unit Control/UnitMoveSystem.cs: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | using Unity.Mathematics; 3 | using Unity.Transforms; 4 | 5 | namespace UnitControl 6 | { 7 | public class UnitMoveSystem : SystemBase 8 | { 9 | protected override void OnUpdate() 10 | { 11 | var dt = Time.DeltaTime; 12 | Entities 13 | .WithAll() 14 | .ForEach((Entity entity, ref MoveComponent moveComp, ref Translation translation) => 15 | { 16 | if (moveComp.IsMoving) 17 | { 18 | float reachedPositionDist = 1f; 19 | if (math.distance(translation.Value, moveComp.TargetPosition) > reachedPositionDist) 20 | { 21 | var moveDir = math.normalize(moveComp.TargetPosition - translation.Value); 22 | moveComp.LastMoveDirection = moveDir; 23 | translation.Value += moveDir * moveComp.MoveSpeed * dt; 24 | } 25 | else 26 | { 27 | moveComp.IsMoving = false; 28 | } 29 | } 30 | }).Run(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Assets/Utils/MousePositionUtils.cs: -------------------------------------------------------------------------------- 1 | using Unity.Mathematics; 2 | using UnityEngine; 3 | 4 | public static class MousePositionUtils 5 | { 6 | public static float3 MouseToTerrainPositionECS() 7 | { 8 | float3 position = float3.zero; 9 | var ray = Camera.main.ScreenPointToRay(Input.mousePosition); 10 | if (Physics.Raycast(ray, out RaycastHit info, 10000, LayerMask.GetMask("Level"))) 11 | { 12 | position = info.point; 13 | } 14 | return position; 15 | } 16 | 17 | public static Vector3 MouseToTerrainPosition() 18 | { 19 | Vector3 position = Vector3.zero; 20 | var ray = Camera.main.ScreenPointToRay(Input.mousePosition); 21 | if (Physics.Raycast(ray, out RaycastHit info, 10000, LayerMask.GetMask("Level"))) 22 | { 23 | position = info.point; 24 | } 25 | return position; 26 | } 27 | 28 | public static RaycastHit CameraRay() 29 | { 30 | var ray = Camera.main.ScreenPointToRay(Input.mousePosition); 31 | if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out RaycastHit info)) 32 | { 33 | return info; 34 | } 35 | return new RaycastHit(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Asset meta data should only be ignored when the corresponding asset is also ignored 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # Autogenerated Jetbrains Rider plugin 20 | [Aa]ssets/Plugins/Editor/JetBrains* 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | 25 | # Gradle cache directory 26 | .gradle/ 27 | 28 | # Autogenerated VS/MD/Consulo solution and project files 29 | ExportedObj/ 30 | .consulo/ 31 | *.csproj 32 | *.unityproj 33 | *.sln 34 | *.suo 35 | *.tmp 36 | *.user 37 | *.userprefs 38 | *.pidb 39 | *.booproj 40 | *.svd 41 | *.pdb 42 | *.mdb 43 | *.opendb 44 | *.VC.db 45 | 46 | # Unity3D generated meta files 47 | *.pidb.meta 48 | *.pdb.meta 49 | *.mdb.meta 50 | 51 | # Unity3D generated file on crash reports 52 | sysinfo.txt 53 | 54 | # Builds 55 | *.apk 56 | *.unitypackage 57 | 58 | # Crashlytics generated file 59 | crashlytics-build.properties 60 | 61 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /Assets/ECS + Job/TestController.cs: -------------------------------------------------------------------------------- 1 | using Unity.Collections; 2 | using Unity.Entities; 3 | using Unity.Mathematics; 4 | using Unity.Rendering; 5 | using Unity.Transforms; 6 | using UnityEngine; 7 | using Random = UnityEngine.Random; 8 | 9 | namespace EcsSample 10 | { 11 | public class TestController : MonoBehaviour 12 | { 13 | [SerializeField] private Mesh mesh; 14 | [SerializeField] private Material material; 15 | [SerializeField] private int count = 1000; 16 | void Start() 17 | { 18 | 19 | var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager; 20 | // Add entity achetype 21 | var entityArchetype = entityManager.CreateArchetype( 22 | typeof(MoveSpeedComponent), 23 | typeof(Translation), 24 | typeof(RenderMesh), 25 | typeof(LocalToWorld), 26 | typeof(RenderBounds)); 27 | var entityArray = new NativeArray(count, Allocator.Temp); 28 | // Instantiate entities 29 | entityManager.CreateEntity(entityArchetype, entityArray); 30 | for (int i = 0; i < entityArray.Length; i++) 31 | { 32 | var entity = entityArray[i]; 33 | entityManager.SetComponentData(entity, new MoveSpeedComponent { MoveSpeed = Random.Range(1f, 2f) }); 34 | entityManager.SetComponentData(entity, new Translation { Value = new float3(Random.Range(-8f, 8f), Random.Range(-5f, 5f), 0) }); 35 | 36 | entityManager.SetSharedComponentData(entity, new RenderMesh 37 | { 38 | mesh = this.mesh, 39 | material = this.material 40 | }); 41 | } 42 | 43 | entityArray.Dispose(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /UserSettings/EditorUserSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!162 &1 4 | EditorUserSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_ConfigSettings: 8 | RecentlyUsedScenePath-0: 9 | value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d 10 | flags: 0 11 | RecentlyUsedScenePath-1: 12 | value: 224247031146467e2e3d430733101105181e0c33 13 | flags: 0 14 | RecentlyUsedScenePath-2: 15 | value: 2242470311464671020c1f6d3a2c5d03580216233831 16 | flags: 0 17 | RecentlyUsedScenePath-3: 18 | value: 22424703114646760c1c052c153069032c181528252d357f0a281036d1e33136e7d81be8f53331392a34fc060b330336f719471ef8021e12 19 | flags: 0 20 | RecentlyUsedScenePath-4: 21 | value: 2242470311464679020708315f721637171a1d052e222333393a5210eee1272bebe478fce9332b25 22 | flags: 0 23 | RecentlyUsedScenePath-5: 24 | value: 224247031146467e2e3d4c695009501259323b196c63661a222b5326ece92021 25 | flags: 0 26 | RecentlyUsedScenePath-6: 27 | value: 2242470311464679020708315f71163535245300232a357f080a2e78c8ef362bacf238e0f323 28 | flags: 0 29 | RecentlyUsedScenePath-7: 30 | value: 224247031146466b1f0b0a23121750351803113e35671622282f1c31d6ef1136f6ee22f0a92f31352d1b 31 | flags: 0 32 | RecentlyUsedScenePath-8: 33 | value: 224247031146466e03071862332c51040418146519262f246d0a123df6f23b34acf238e0f323 34 | flags: 0 35 | vcSharedLogLevel: 36 | value: 0d5e400f0650 37 | flags: 0 38 | m_VCAutomaticAdd: 1 39 | m_VCDebugCom: 0 40 | m_VCDebugCmd: 0 41 | m_VCDebugOut: 0 42 | m_SemanticMergeMode: 2 43 | m_VCShowFailedCheckout: 1 44 | m_VCOverwriteFailedCheckoutAssets: 1 45 | m_VCProjectOverlayIcons: 1 46 | m_VCHierarchyOverlayIcons: 1 47 | m_VCOtherOverlayIcons: 1 48 | m_VCAllowAsyncUpdate: 1 49 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Textures/BlackBird_Colorscheme.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ed637b74b50b194c8c8f5ebe40273a6 3 | timeCreated: 1500576863 4 | licenseType: Store 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 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: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 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: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 0 46 | spriteTessellationDetail: -1 47 | textureType: 0 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 | spriteSheet: 62 | serializedVersion: 2 63 | sprites: [] 64 | outline: [] 65 | spritePackingTag: 66 | userData: 67 | assetBundleName: 68 | assetBundleVariant: 69 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Textures/WhiteBird_Colorscheme.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9fafa1f014545c47a16e562586e3c00 3 | timeCreated: 1500580584 4 | licenseType: Store 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 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: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 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: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 0 46 | spriteTessellationDetail: -1 47 | textureType: 0 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 | spriteSheet: 62 | serializedVersion: 2 63 | sprites: [] 64 | outline: [] 65 | spritePackingTag: 66 | userData: 67 | assetBundleName: 68 | assetBundleVariant: 69 | -------------------------------------------------------------------------------- /Assets/Jobs/TestController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using Unity.Jobs; 4 | using Unity.Mathematics; 5 | using UnityEngine; 6 | using Unity.Collections; 7 | using Unity.Burst; 8 | 9 | namespace JobsSample 10 | { 11 | public class TestController : MonoBehaviour 12 | { 13 | [SerializeField] private bool useJobs = false; 14 | void Start() 15 | { 16 | 17 | } 18 | 19 | void Update() 20 | { 21 | var startTime = Time.realtimeSinceStartup; 22 | if (useJobs) 23 | { 24 | var jobHandleList = new NativeList(Allocator.Temp); 25 | for (int i = 0; i < 10; i++) 26 | { 27 | var jobHandle = DoSomeCalculationsJob(); 28 | jobHandleList.Add(jobHandle); 29 | } 30 | JobHandle.CompleteAll(jobHandleList); 31 | } 32 | else 33 | { 34 | for (int i = 0; i < 10; i++) 35 | { 36 | DoSomeCalculations(); 37 | } 38 | } 39 | Debug.Log(((Time.realtimeSinceStartup - startTime) * 1000f) + "ms"); 40 | } 41 | 42 | private void DoSomeCalculations() 43 | { 44 | var value = 0f; 45 | for (int i = 0; i < 50000; i++) 46 | { 47 | value = math.exp10(math.sqrt(value)); 48 | } 49 | } 50 | 51 | private JobHandle DoSomeCalculationsJob() 52 | { 53 | var job = new DoSomeCalculationsJob(); 54 | return job.Schedule(); 55 | } 56 | } 57 | 58 | [BurstCompile] 59 | public struct DoSomeCalculationsJob : IJob 60 | { 61 | public void Execute() 62 | { 63 | var value = 0f; 64 | for (int i = 0; i < 50000; i++) 65 | { 66 | value = math.exp10(math.sqrt(value)); 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.burst": "1.4.1", 4 | "com.unity.collab-proxy": "1.5.7", 5 | "com.unity.entities": "0.17.0-preview.42", 6 | "com.unity.ide.rider": "2.0.7", 7 | "com.unity.ide.visualstudio": "2.0.8", 8 | "com.unity.ide.vscode": "1.2.3", 9 | "com.unity.jobs": "0.8.0-preview.23", 10 | "com.unity.mathematics": "1.2.1", 11 | "com.unity.rendering.hybrid": "0.11.0-preview.44", 12 | "com.unity.test-framework": "1.1.24", 13 | "com.unity.textmeshpro": "3.0.6", 14 | "com.unity.timeline": "1.4.8", 15 | "com.unity.ugui": "1.0.0", 16 | "com.unity.modules.ai": "1.0.0", 17 | "com.unity.modules.androidjni": "1.0.0", 18 | "com.unity.modules.animation": "1.0.0", 19 | "com.unity.modules.assetbundle": "1.0.0", 20 | "com.unity.modules.audio": "1.0.0", 21 | "com.unity.modules.cloth": "1.0.0", 22 | "com.unity.modules.director": "1.0.0", 23 | "com.unity.modules.imageconversion": "1.0.0", 24 | "com.unity.modules.imgui": "1.0.0", 25 | "com.unity.modules.jsonserialize": "1.0.0", 26 | "com.unity.modules.particlesystem": "1.0.0", 27 | "com.unity.modules.physics": "1.0.0", 28 | "com.unity.modules.physics2d": "1.0.0", 29 | "com.unity.modules.screencapture": "1.0.0", 30 | "com.unity.modules.terrain": "1.0.0", 31 | "com.unity.modules.terrainphysics": "1.0.0", 32 | "com.unity.modules.tilemap": "1.0.0", 33 | "com.unity.modules.ui": "1.0.0", 34 | "com.unity.modules.uielements": "1.0.0", 35 | "com.unity.modules.umbra": "1.0.0", 36 | "com.unity.modules.unityanalytics": "1.0.0", 37 | "com.unity.modules.unitywebrequest": "1.0.0", 38 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 39 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 40 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 41 | "com.unity.modules.unitywebrequestwww": "1.0.0", 42 | "com.unity.modules.vehicles": "1.0.0", 43 | "com.unity.modules.video": "1.0.0", 44 | "com.unity.modules.vr": "1.0.0", 45 | "com.unity.modules.wind": "1.0.0", 46 | "com.unity.modules.xr": "1.0.0" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Materials/BoidMat 1.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: BoidMat 1 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _EMISSION 13 | m_LightmapFlags: 2 14 | m_EnableInstancingVariants: 1 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.4 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0.1137255, g: 0.6313726, b: 0.9490197, a: 1} 77 | - _EmissionColor: {r: 0.012286487, g: 0.35640025, b: 0.8879232, a: 1} 78 | m_BuildTextureStacks: [] 79 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Meshes/Bird.FBX.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23967a2b7e2d84b44a132368a6f1d15c 3 | timeCreated: 1500581242 4 | licenseType: Store 5 | ModelImporter: 6 | serializedVersion: 19 7 | fileIDToRecycleName: 8 | 100000: //RootNode 9 | 100002: Bird 1 10 | 100004: lf_Wing 11 | 100006: rt_Wing 12 | 400000: //RootNode 13 | 400002: Bird 1 14 | 400004: lf_Wing 15 | 400006: rt_Wing 16 | 2300000: Bird 1 17 | 2300002: lf_Wing 18 | 2300004: rt_Wing 19 | 3300000: Bird 1 20 | 3300002: lf_Wing 21 | 3300004: rt_Wing 22 | 4300000: rt_Wing 23 | 4300002: lf_Wing 24 | 4300004: Bird 25 | materials: 26 | importMaterials: 0 27 | materialName: 0 28 | materialSearch: 1 29 | animations: 30 | legacyGenerateAnimations: 4 31 | bakeSimulation: 0 32 | resampleCurves: 1 33 | optimizeGameObjects: 0 34 | motionNodeName: 35 | animationImportErrors: 36 | animationImportWarnings: 37 | animationRetargetingWarnings: 38 | animationDoRetargetingWarnings: 0 39 | animationCompression: 1 40 | animationRotationError: 0.5 41 | animationPositionError: 0.5 42 | animationScaleError: 0.5 43 | animationWrapMode: 0 44 | extraExposedTransformPaths: [] 45 | clipAnimations: [] 46 | isReadable: 1 47 | meshes: 48 | lODScreenPercentages: [] 49 | globalScale: 1 50 | meshCompression: 0 51 | addColliders: 0 52 | importBlendShapes: 1 53 | swapUVChannels: 0 54 | generateSecondaryUV: 0 55 | useFileUnits: 1 56 | optimizeMeshForGPU: 1 57 | keepQuads: 0 58 | weldVertices: 1 59 | secondaryUVAngleDistortion: 8 60 | secondaryUVAreaDistortion: 15.000001 61 | secondaryUVHardAngle: 88 62 | secondaryUVPackMargin: 4 63 | useFileScale: 1 64 | tangentSpace: 65 | normalSmoothAngle: 60 66 | normalImportMode: 0 67 | tangentImportMode: 3 68 | importAnimation: 1 69 | copyAvatar: 0 70 | humanDescription: 71 | serializedVersion: 2 72 | human: [] 73 | skeleton: [] 74 | armTwist: 0.5 75 | foreArmTwist: 0.5 76 | upperLegTwist: 0.5 77 | legTwist: 0.5 78 | armStretch: 0.05 79 | legStretch: 0.05 80 | feetSpacing: 0 81 | rootMotionBoneName: 82 | rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} 83 | hasTranslationDoF: 0 84 | hasExtraRoot: 0 85 | skeletonHasParents: 1 86 | lastHumanDescriptionAvatarSource: {instanceID: 0} 87 | animationType: 0 88 | humanoidOversampling: 1 89 | additionalBone: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Assets/Unit Control/SelectionArea.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: SelectionArea 11 | m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _ALPHAPREMULTIPLY_ON 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _AlphaTex: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _BumpMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailAlbedoMap: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailMask: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _DetailNormalMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _EmissionMap: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MainTex: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _MetallicGlossMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _OcclusionMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | - _ParallaxMap: 59 | m_Texture: {fileID: 0} 60 | m_Scale: {x: 1, y: 1} 61 | m_Offset: {x: 0, y: 0} 62 | m_Floats: 63 | - PixelSnap: 0 64 | - _BumpScale: 1 65 | - _Cutoff: 0.5 66 | - _DetailNormalMapScale: 1 67 | - _DstBlend: 10 68 | - _EnableExternalAlpha: 0 69 | - _GlossMapScale: 1 70 | - _Glossiness: 0.5 71 | - _GlossyReflections: 1 72 | - _Metallic: 0 73 | - _Mode: 3 74 | - _OcclusionStrength: 1 75 | - _Parallax: 0.02 76 | - _SmoothnessTextureChannel: 0 77 | - _SpecularHighlights: 1 78 | - _SrcBlend: 1 79 | - _UVSec: 0 80 | - _ZWrite: 0 81 | m_Colors: 82 | - _Color: {r: 0, g: 1, b: 0, a: 0.47058824} 83 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 84 | - _Flip: {r: 1, g: 1, b: 1, a: 1} 85 | - _RendererColor: {r: 1, g: 1, b: 1, a: 1} 86 | m_BuildTextureStacks: [] 87 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Materials/EmissiveBird_Colorscheme.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: EmissiveBird_Colorscheme 11 | m_Shader: {fileID: 41, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _EMISSION 13 | m_LightmapFlags: 1 14 | m_EnableInstancingVariants: 1 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _LightMap: 43 | m_Texture: {fileID: 2800000, guid: b9fafa1f014545c47a16e562586e3c00, type: 3} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MainTex: 47 | m_Texture: {fileID: 2800000, guid: b9fafa1f014545c47a16e562586e3c00, type: 3} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _MetallicGlossMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _OcclusionMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | - _ParallaxMap: 59 | m_Texture: {fileID: 0} 60 | m_Scale: {x: 1, y: 1} 61 | m_Offset: {x: 0, y: 0} 62 | m_Floats: 63 | - _BumpScale: 1 64 | - _Cutoff: 0.5 65 | - _DetailNormalMapScale: 1 66 | - _DstBlend: 0 67 | - _GlossMapScale: 1 68 | - _Glossiness: 0.5 69 | - _GlossyReflections: 1 70 | - _Metallic: 0 71 | - _Mode: 0 72 | - _OcclusionStrength: 1 73 | - _Parallax: 0.02 74 | - _SmoothnessTextureChannel: 0 75 | - _SpecularHighlights: 1 76 | - _SrcBlend: 1 77 | - _UVSec: 0 78 | - _ZWrite: 1 79 | m_Colors: 80 | - _Color: {r: 1, g: 1, b: 1, a: 1} 81 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 82 | m_BuildTextureStacks: [] 83 | -------------------------------------------------------------------------------- /Assets/Unit Control/SelectedCircle.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: SelectedCircle 11 | m_Shader: {fileID: 30, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _ALPHAPREMULTIPLY_ON 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 1 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _AlphaTex: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _BumpMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailAlbedoMap: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailMask: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _DetailNormalMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _EmissionMap: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MainTex: 47 | m_Texture: {fileID: 2800000, guid: e89893bce8ffb284c8b42317436ca10c, type: 3} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _MetallicGlossMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _OcclusionMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | - _ParallaxMap: 59 | m_Texture: {fileID: 0} 60 | m_Scale: {x: 1, y: 1} 61 | m_Offset: {x: 0, y: 0} 62 | m_Floats: 63 | - PixelSnap: 0 64 | - _BumpScale: 1 65 | - _Cutoff: 0.5 66 | - _DetailNormalMapScale: 1 67 | - _DstBlend: 10 68 | - _EnableExternalAlpha: 0 69 | - _GlossMapScale: 1 70 | - _Glossiness: 0.5 71 | - _GlossyReflections: 1 72 | - _Metallic: 0 73 | - _Mode: 3 74 | - _OcclusionStrength: 1 75 | - _Parallax: 0.02 76 | - _SmoothnessTextureChannel: 0 77 | - _SpecularHighlights: 1 78 | - _SrcBlend: 1 79 | - _UVSec: 0 80 | - _ZWrite: 0 81 | m_Colors: 82 | - _Color: {r: 0, g: 1, b: 0, a: 1} 83 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 84 | - _Flip: {r: 1, g: 1, b: 1, a: 1} 85 | - _RendererColor: {r: 1, g: 1, b: 1, a: 1} 86 | m_BuildTextureStacks: [] 87 | -------------------------------------------------------------------------------- /Assets/Boids/1)GameObjects/BoidsManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | namespace Boid.Classic 8 | { 9 | public class BoidsManager : MonoBehaviour 10 | { 11 | public static BoidsManager Instance; 12 | 13 | public float BoidSpeed = 20; 14 | public float BoidDetectRadius = 50; 15 | public float CageSize = 500; 16 | public int IncrementAmount = 50; 17 | 18 | public float SeparationWeight = 25; 19 | public float CohesionWeight = 5; 20 | public float AlignmentWeight = 15; 21 | 22 | public float AvoidWallsWeight = 10; 23 | public float AvoidWallsTurnDist = 20; 24 | 25 | public List Boids; 26 | 27 | [SerializeField] private int boidAmount = 10; 28 | [SerializeField] private GameObject boidPrefab; 29 | [SerializeField] private Text statsText; 30 | 31 | // Start is called before the first frame update 32 | void Start() 33 | { 34 | Instance = this; 35 | Boids.Clear(); 36 | AddBoid(boidAmount); 37 | } 38 | 39 | private void Update() 40 | { 41 | statsText.text = $"FPS: {(int)(1.0f / Time.deltaTime)}\n" + 42 | $"Total boids: {Boids.Count}"; 43 | } 44 | 45 | public void AddBoid(int amount) 46 | { 47 | for (int i = 0; i < amount; i++) 48 | { 49 | var pos = new Vector3(Random.Range(-CageSize / 2f, CageSize / 2f), 50 | Random.Range(-CageSize / 2f, CageSize / 2f), 51 | Random.Range(-CageSize / 2f, CageSize / 2f)); 52 | var rot = Quaternion.Euler(Random.Range(0, 360), 53 | Random.Range(0, 360), 54 | Random.Range(0, 360)); 55 | 56 | var newBoid = Instantiate(boidPrefab, pos, rot).GetComponent(); 57 | Boids.Add(newBoid); 58 | } 59 | } 60 | 61 | private void OnDrawGizmos() 62 | { 63 | 64 | Gizmos.color = Color.red; 65 | Gizmos.DrawWireCube( 66 | Vector3.zero, 67 | new Vector3( 68 | CageSize, 69 | CageSize, 70 | CageSize 71 | ) 72 | ); 73 | } 74 | } 75 | 76 | [CustomEditor(typeof(BoidsManager))] 77 | public class BoidsManagerEditor : Editor 78 | { 79 | public override void OnInspectorGUI() 80 | { 81 | DrawDefaultInspector(); 82 | 83 | var boidsManager = (BoidsManager)target; 84 | if (GUILayout.Button("Add 50 Boids")) 85 | { 86 | boidsManager.AddBoid(boidsManager.IncrementAmount); 87 | } 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /Assets/ECS + Job/SpriteMat.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: SpriteMat 11 | m_Shader: {fileID: 30, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 1 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _AlphaTex: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _BumpMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailAlbedoMap: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailMask: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _DetailNormalMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _EmissionMap: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MainTex: 47 | m_Texture: {fileID: 2800000, guid: 56f83052b65507445b1563a6acdf1664, type: 3} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _MetallicGlossMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _OcclusionMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | - _ParallaxMap: 59 | m_Texture: {fileID: 0} 60 | m_Scale: {x: 1, y: 1} 61 | m_Offset: {x: 0, y: 0} 62 | m_Floats: 63 | - PixelSnap: 0 64 | - _BumpScale: 1 65 | - _ColorMask: 15 66 | - _Cutoff: 0.5 67 | - _DetailNormalMapScale: 1 68 | - _DstBlend: 0 69 | - _EnableExternalAlpha: 0 70 | - _GlossMapScale: 1 71 | - _Glossiness: 0.5 72 | - _GlossyReflections: 1 73 | - _Metallic: 0 74 | - _Mode: 0 75 | - _OcclusionStrength: 1 76 | - _Parallax: 0.02 77 | - _SmoothnessTextureChannel: 0 78 | - _SpecularHighlights: 1 79 | - _SrcBlend: 1 80 | - _Stencil: 0 81 | - _StencilComp: 8 82 | - _StencilOp: 0 83 | - _StencilReadMask: 255 84 | - _StencilWriteMask: 255 85 | - _UVSec: 0 86 | - _UseUIAlphaClip: 0 87 | - _ZWrite: 1 88 | m_Colors: 89 | - _Color: {r: 1, g: 1, b: 1, a: 1} 90 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 91 | - _Flip: {r: 1, g: 1, b: 1, a: 1} 92 | - _RendererColor: {r: 1, g: 1, b: 1, a: 1} 93 | - _Specular: {r: 0, g: 0, b: 0, a: 0} 94 | m_BuildTextureStacks: [] 95 | -------------------------------------------------------------------------------- /Assets/Boids/2)ECS+Jobs/BoidSpawnSystem.cs: -------------------------------------------------------------------------------- 1 | using Unity.Burst; 2 | using Unity.Collections; 3 | using Unity.Collections.LowLevel.Unsafe; 4 | using Unity.Entities; 5 | using Unity.Jobs; 6 | using Unity.Mathematics; 7 | using Unity.Transforms; 8 | 9 | namespace Boid.ECS 10 | { 11 | public class BoidSpawnSystem : SystemBase 12 | { 13 | [BurstCompile] 14 | private struct SetBoidPosition : IJobParallelFor 15 | { 16 | [NativeDisableContainerSafetyRestriction] 17 | [NativeDisableParallelForRestriction] 18 | public ComponentDataFromEntity TranslationFromEntity; 19 | [NativeDisableContainerSafetyRestriction] 20 | [NativeDisableParallelForRestriction] 21 | public ComponentDataFromEntity RotationFromEntity; 22 | 23 | public NativeArray Entites; 24 | public int CageSize; 25 | 26 | public void Execute(int index) 27 | { 28 | var entity = Entites[index]; 29 | var random = new Random(((uint)(entity.Index + index + 1) * 0x9F6ABC1)); 30 | var translation = new Translation 31 | { 32 | Value = new float3(random.NextFloat(-CageSize / 2, CageSize / 2), 33 | random.NextFloat(-CageSize / 2, CageSize / 2), 34 | random.NextFloat(-CageSize / 2, CageSize / 2)) 35 | }; 36 | var rotation = new Rotation { Value = quaternion.LookRotationSafe(math.normalizesafe(random.NextFloat3()), math.up()) }; 37 | TranslationFromEntity[entity] = translation; 38 | RotationFromEntity[entity] = rotation; 39 | } 40 | } 41 | 42 | protected override void OnUpdate() 43 | { 44 | Entities 45 | .WithStructuralChanges() 46 | .WithName("EntitiesSpawnerSystem") 47 | .ForEach((Entity entity, in BoidPrefabComponent boidPrefabEntity) => 48 | { 49 | var entities = new NativeArray(boidPrefabEntity.Count, Allocator.TempJob); 50 | EntityManager.Instantiate(boidPrefabEntity.BoidPrefab, entities); 51 | 52 | // Use Job 53 | var translationFromEntity = GetComponentDataFromEntity(); 54 | var rotationFromEntity = GetComponentDataFromEntity(); 55 | 56 | var setBoidPositionJob = new SetBoidPosition 57 | { 58 | TranslationFromEntity = translationFromEntity, 59 | RotationFromEntity = rotationFromEntity, 60 | Entites = entities, 61 | CageSize = boidPrefabEntity.CageSize 62 | }; 63 | Dependency = setBoidPositionJob.Schedule(boidPrefabEntity.Count, 64, Dependency); 64 | Dependency = entities.Dispose(Dependency); 65 | 66 | EntityManager.DestroyEntity(entity); 67 | }).Run(); 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Textures/GlowTexture.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01d037806d2e199459b3fa81fe5a3c6a 3 | timeCreated: 1500740570 4 | licenseType: Store 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 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: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 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: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 0 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 128 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 128 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 128 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 128 79 | textureFormat: -1 80 | textureCompression: 1 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: Tizen 86 | maxTextureSize: 128 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | - buildTarget: WebGL 94 | maxTextureSize: 128 95 | textureFormat: -1 96 | textureCompression: 1 97 | compressionQuality: 50 98 | crunchedCompression: 0 99 | allowsAlphaSplitting: 0 100 | overridden: 0 101 | - buildTarget: Samsung TV 102 | maxTextureSize: 128 103 | textureFormat: -1 104 | textureCompression: 1 105 | compressionQuality: 50 106 | crunchedCompression: 0 107 | allowsAlphaSplitting: 0 108 | overridden: 0 109 | spriteSheet: 110 | serializedVersion: 2 111 | sprites: [] 112 | outline: [] 113 | spritePackingTag: 114 | userData: 115 | assetBundleName: 116 | assetBundleVariant: 117 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Textures/SquareGlowTexture.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c4242f3bbb2a124ba965ff11436eddb 3 | timeCreated: 1500740570 4 | licenseType: Store 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 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: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 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: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 0 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 128 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 128 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 128 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 128 79 | textureFormat: -1 80 | textureCompression: 1 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: Tizen 86 | maxTextureSize: 128 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | - buildTarget: WebGL 94 | maxTextureSize: 128 95 | textureFormat: -1 96 | textureCompression: 1 97 | compressionQuality: 50 98 | crunchedCompression: 0 99 | allowsAlphaSplitting: 0 100 | overridden: 0 101 | - buildTarget: Samsung TV 102 | maxTextureSize: 128 103 | textureFormat: -1 104 | textureCompression: 1 105 | compressionQuality: 50 106 | crunchedCompression: 0 107 | allowsAlphaSplitting: 0 108 | overridden: 0 109 | spriteSheet: 110 | serializedVersion: 2 111 | sprites: [] 112 | outline: [] 113 | spritePackingTag: 114 | userData: 115 | assetBundleName: 116 | assetBundleVariant: 117 | -------------------------------------------------------------------------------- /Assets/ECS + Job/pngfind.com-sprite-logo-png-2398144.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56f83052b65507445b1563a6acdf1664 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 2 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | - serializedVersion: 3 91 | buildTarget: Android 92 | maxTextureSize: 2048 93 | resizeAlgorithm: 0 94 | textureFormat: -1 95 | textureCompression: 1 96 | compressionQuality: 50 97 | crunchedCompression: 0 98 | allowsAlphaSplitting: 0 99 | overridden: 0 100 | androidETC2FallbackOverride: 0 101 | forceMaximumCompressionQuality_BC6H_BC7: 0 102 | spriteSheet: 103 | serializedVersion: 2 104 | sprites: [] 105 | outline: [] 106 | physicsShape: [] 107 | bones: [] 108 | spriteID: 109 | internalID: 0 110 | vertices: [] 111 | indices: 112 | edges: [] 113 | weights: [] 114 | secondaryTextures: [] 115 | spritePackingTag: 116 | pSDRemoveMatte: 0 117 | pSDShowRemoveMatteOption: 0 118 | userData: 119 | assetBundleName: 120 | assetBundleVariant: 121 | -------------------------------------------------------------------------------- /Assets/Unit Control/Circle.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e89893bce8ffb284c8b42317436ca10c 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | - serializedVersion: 3 91 | buildTarget: Android 92 | maxTextureSize: 2048 93 | resizeAlgorithm: 0 94 | textureFormat: -1 95 | textureCompression: 1 96 | compressionQuality: 50 97 | crunchedCompression: 0 98 | allowsAlphaSplitting: 0 99 | overridden: 0 100 | androidETC2FallbackOverride: 0 101 | forceMaximumCompressionQuality_BC6H_BC7: 0 102 | spriteSheet: 103 | serializedVersion: 2 104 | sprites: [] 105 | outline: [] 106 | physicsShape: [] 107 | bones: [] 108 | spriteID: 5e97eb03825dee720800000000000000 109 | internalID: 0 110 | vertices: [] 111 | indices: 112 | edges: [] 113 | weights: [] 114 | secondaryTextures: [] 115 | spritePackingTag: 116 | pSDRemoveMatte: 0 117 | pSDShowRemoveMatteOption: 0 118 | userData: 119 | assetBundleName: 120 | assetBundleVariant: 121 | -------------------------------------------------------------------------------- /Assets/Boids/1)GameObjects/Boid.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Boid.Classic 6 | { 7 | public class Boid : MonoBehaviour 8 | { 9 | private BoidsManager boidsManager; 10 | 11 | private Vector3 separationForce; 12 | private Vector3 cohesionForce; 13 | private Vector3 alignmentForces; 14 | private Vector3 avoidWallsForce; 15 | 16 | private void Start() 17 | { 18 | boidsManager = BoidsManager.Instance; 19 | } 20 | 21 | private void Update() 22 | { 23 | CalculateForce(); 24 | MoveForward(); 25 | } 26 | 27 | private void CalculateForce() 28 | { 29 | var seperationSum = Vector3.zero; 30 | var positionSum = Vector3.zero; 31 | var headingSum = Vector3.zero; 32 | 33 | int boidsNearby = 0; 34 | 35 | for (int i = 0; i < boidsManager.Boids.Count; ++i) 36 | { 37 | var otherBoidsPosition = boidsManager.Boids[i].transform.position; 38 | float distToOtherBoid = (transform.position - otherBoidsPosition).magnitude; 39 | 40 | if (distToOtherBoid < boidsManager.BoidDetectRadius) 41 | { 42 | seperationSum += -(otherBoidsPosition - transform.position) * (1f / Mathf.Max(distToOtherBoid, .0001f)); 43 | positionSum += otherBoidsPosition; 44 | headingSum += boidsManager.Boids[i].transform.forward; 45 | boidsNearby++; 46 | } 47 | } 48 | 49 | if (boidsNearby > 0) 50 | { 51 | separationForce = seperationSum / boidsNearby; 52 | cohesionForce = (positionSum / boidsNearby) - transform.position; 53 | alignmentForces = headingSum / boidsNearby; 54 | } 55 | else 56 | { 57 | separationForce = Vector3.zero; 58 | cohesionForce = Vector3.zero; 59 | alignmentForces = Vector3.zero; 60 | } 61 | 62 | if (MinDistanceToBorder(transform.position, boidsManager.CageSize) < boidsManager.AvoidWallsTurnDist) 63 | { 64 | avoidWallsForce = -transform.position.normalized; 65 | } 66 | else 67 | { 68 | avoidWallsForce = Vector3.zero; 69 | } 70 | 71 | } 72 | 73 | private void MoveForward() 74 | { 75 | var force = separationForce * boidsManager.SeparationWeight + 76 | cohesionForce * boidsManager.CohesionWeight + 77 | alignmentForces * boidsManager.AlignmentWeight + 78 | avoidWallsForce * boidsManager.AvoidWallsWeight; 79 | 80 | var velocity = transform.forward * boidsManager.BoidSpeed; 81 | velocity += force * Time.deltaTime; 82 | velocity = velocity.normalized * boidsManager.BoidSpeed; 83 | 84 | transform.position += velocity * Time.deltaTime; 85 | transform.rotation = Quaternion.LookRotation(velocity); 86 | 87 | } 88 | 89 | private float MinDistanceToBorder(Vector3 postion, float cageSize) 90 | { 91 | var halfCageSize = cageSize / 2f; 92 | return Mathf.Min(Mathf.Min(halfCageSize - Mathf.Abs(postion.x), halfCageSize - Mathf.Abs(postion.y)), halfCageSize - Mathf.Abs(postion.z)); 93 | } 94 | } 95 | } -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Materials/BlackBird_Colorscheme.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: BlackBird_Colorscheme 10 | m_Shader: {fileID: 10703, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 2800000, guid: 0ed637b74b50b194c8c8f5ebe40273a6, type: 3} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - first: 74 | name: _BumpScale 75 | second: 1 76 | - first: 77 | name: _Cutoff 78 | second: 0.5 79 | - first: 80 | name: _DetailNormalMapScale 81 | second: 1 82 | - first: 83 | name: _DstBlend 84 | second: 0 85 | - first: 86 | name: _GlossMapScale 87 | second: 1 88 | - first: 89 | name: _Glossiness 90 | second: 0.5 91 | - first: 92 | name: _GlossyReflections 93 | second: 1 94 | - first: 95 | name: _Metallic 96 | second: 0 97 | - first: 98 | name: _Mode 99 | second: 0 100 | - first: 101 | name: _OcclusionStrength 102 | second: 1 103 | - first: 104 | name: _Parallax 105 | second: 0.02 106 | - first: 107 | name: _SmoothnessTextureChannel 108 | second: 0 109 | - first: 110 | name: _SpecularHighlights 111 | second: 1 112 | - first: 113 | name: _SrcBlend 114 | second: 1 115 | - first: 116 | name: _UVSec 117 | second: 0 118 | - first: 119 | name: _ZWrite 120 | second: 1 121 | m_Colors: 122 | - first: 123 | name: _Color 124 | second: {r: 1, g: 1, b: 1, a: 1} 125 | - first: 126 | name: _EmissionColor 127 | second: {r: 0, g: 0, b: 0, a: 1} 128 | -------------------------------------------------------------------------------- /Assets/PrefabToEntity/EntitiesSpawnerSystem.cs: -------------------------------------------------------------------------------- 1 | using Unity.Burst; 2 | using Unity.Collections; 3 | using Unity.Collections.LowLevel.Unsafe; 4 | using Unity.Entities; 5 | using Unity.Jobs; 6 | using Unity.Mathematics; 7 | using Unity.Rendering; 8 | using Unity.Transforms; 9 | using UnitControl; 10 | 11 | namespace PrefabToEntity 12 | { 13 | public class EntitiesSpawnerSystem : SystemBase 14 | { 15 | [BurstCompile] 16 | private struct SetPosition : IJobParallelFor 17 | { 18 | [NativeDisableContainerSafetyRestriction] 19 | [NativeDisableParallelForRestriction] 20 | public ComponentDataFromEntity TranslationFromEntity; 21 | public NativeArray Entites; 22 | [ReadOnly] 23 | public SpawnAxis SpawnAxis; 24 | public void Execute(int index) 25 | { 26 | var entity = Entites[index]; 27 | var random = new Random(((uint)(entity.Index + index + 1) * 0x9F6ABC1)); 28 | var translation = new Translation { }; 29 | if (SpawnAxis == SpawnAxis.XY) 30 | { 31 | translation = new Translation { Value = new float3(random.NextFloat(-5f, 5f), random.NextFloat(-5f, 5f), 0) }; 32 | } 33 | else if (SpawnAxis == SpawnAxis.XZ) 34 | { 35 | translation = new Translation { Value = new float3(random.NextFloat(-10f, 10f), 1.1f, random.NextFloat(-10f, 10f)) }; 36 | } 37 | TranslationFromEntity[entity] = translation; 38 | } 39 | } 40 | 41 | protected override void OnUpdate() 42 | { 43 | // What is structural changes: https://docs.unity3d.com/Packages/com.unity.entities@0.4/manual/sync_points.html 44 | Entities 45 | .WithStructuralChanges() 46 | .WithName("EntitiesSpawnerSystem") 47 | .ForEach((Entity entity, in PrefabEntityComponent prefabEntityComponent) => 48 | { 49 | var entities = new NativeArray(prefabEntityComponent.Count, Allocator.TempJob); 50 | EntityManager.Instantiate(prefabEntityComponent.PrefabEntity, entities); 51 | 52 | // Nested job 53 | //Entities.ForEach((ref Translation translation) => 54 | //{ 55 | // translation.Value.x = random.NextFloat(-5f, 5f); 56 | // translation.Value.y = random.NextFloat(-5f, 5f); 57 | //}).WithoutBurst().Run(); 58 | 59 | // Use Job 60 | var translationFromEntity = GetComponentDataFromEntity(); 61 | var setBoidPositionJob = new SetPosition 62 | { 63 | TranslationFromEntity = translationFromEntity, 64 | Entites = entities, 65 | SpawnAxis = prefabEntityComponent.SpawnAxis 66 | }; 67 | Dependency = setBoidPositionJob.Schedule(prefabEntityComponent.Count, 64, Dependency); 68 | Dependency = entities.Dispose(Dependency); 69 | 70 | EntityManager.DestroyEntity(entity); 71 | //entities.Dispose(); 72 | }).Run(); 73 | 74 | Entities 75 | .WithStructuralChanges() 76 | .WithAll() 77 | .ForEach((Entity entity) => 78 | { 79 | EntityManager.RemoveComponent(entity); 80 | EntityManager.RemoveComponent(entity); 81 | EntityManager.RemoveComponent(entity); 82 | }).Run(); 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /Assets/PrefabToEntity/PrefabGameObject.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &3338548644976901718 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 3338548644976901714} 12 | - component: {fileID: 3338548644976901717} 13 | - component: {fileID: 3338548644976901716} 14 | - component: {fileID: 3338548644976901719} 15 | - component: {fileID: 2048266032614007455} 16 | m_Layer: 0 17 | m_Name: PrefabGameObject 18 | m_TagString: Untagged 19 | m_Icon: {fileID: 0} 20 | m_NavMeshLayer: 0 21 | m_StaticEditorFlags: 0 22 | m_IsActive: 1 23 | --- !u!4 &3338548644976901714 24 | Transform: 25 | m_ObjectHideFlags: 0 26 | m_CorrespondingSourceObject: {fileID: 0} 27 | m_PrefabInstance: {fileID: 0} 28 | m_PrefabAsset: {fileID: 0} 29 | m_GameObject: {fileID: 3338548644976901718} 30 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 31 | m_LocalPosition: {x: 0, y: 0, z: 0} 32 | m_LocalScale: {x: 0.8, y: 1, z: 1} 33 | m_Children: [] 34 | m_Father: {fileID: 0} 35 | m_RootOrder: 0 36 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 37 | --- !u!33 &3338548644976901717 38 | MeshFilter: 39 | m_ObjectHideFlags: 0 40 | m_CorrespondingSourceObject: {fileID: 0} 41 | m_PrefabInstance: {fileID: 0} 42 | m_PrefabAsset: {fileID: 0} 43 | m_GameObject: {fileID: 3338548644976901718} 44 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 45 | --- !u!23 &3338548644976901716 46 | MeshRenderer: 47 | m_ObjectHideFlags: 0 48 | m_CorrespondingSourceObject: {fileID: 0} 49 | m_PrefabInstance: {fileID: 0} 50 | m_PrefabAsset: {fileID: 0} 51 | m_GameObject: {fileID: 3338548644976901718} 52 | m_Enabled: 1 53 | m_CastShadows: 1 54 | m_ReceiveShadows: 1 55 | m_DynamicOccludee: 1 56 | m_MotionVectors: 1 57 | m_LightProbeUsage: 1 58 | m_ReflectionProbeUsage: 1 59 | m_RayTracingMode: 2 60 | m_RayTraceProcedural: 0 61 | m_RenderingLayerMask: 1 62 | m_RendererPriority: 0 63 | m_Materials: 64 | - {fileID: 2100000, guid: 1d8cc0763c5088745a531f3fb15f009c, type: 2} 65 | m_StaticBatchInfo: 66 | firstSubMesh: 0 67 | subMeshCount: 0 68 | m_StaticBatchRoot: {fileID: 0} 69 | m_ProbeAnchor: {fileID: 0} 70 | m_LightProbeVolumeOverride: {fileID: 0} 71 | m_ScaleInLightmap: 1 72 | m_ReceiveGI: 1 73 | m_PreserveUVs: 0 74 | m_IgnoreNormalsForChartDetection: 0 75 | m_ImportantGI: 0 76 | m_StitchLightmapSeams: 1 77 | m_SelectedEditorRenderState: 3 78 | m_MinimumChartSize: 4 79 | m_AutoUVMaxDistance: 0.5 80 | m_AutoUVMaxAngle: 89 81 | m_LightmapParameters: {fileID: 0} 82 | m_SortingLayerID: 0 83 | m_SortingLayer: 0 84 | m_SortingOrder: 0 85 | m_AdditionalVertexStreams: {fileID: 0} 86 | --- !u!64 &3338548644976901719 87 | MeshCollider: 88 | m_ObjectHideFlags: 0 89 | m_CorrespondingSourceObject: {fileID: 0} 90 | m_PrefabInstance: {fileID: 0} 91 | m_PrefabAsset: {fileID: 0} 92 | m_GameObject: {fileID: 3338548644976901718} 93 | m_Material: {fileID: 0} 94 | m_IsTrigger: 0 95 | m_Enabled: 1 96 | serializedVersion: 4 97 | m_Convex: 0 98 | m_CookingOptions: 30 99 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 100 | --- !u!95 &2048266032614007455 101 | Animator: 102 | serializedVersion: 3 103 | m_ObjectHideFlags: 0 104 | m_CorrespondingSourceObject: {fileID: 0} 105 | m_PrefabInstance: {fileID: 0} 106 | m_PrefabAsset: {fileID: 0} 107 | m_GameObject: {fileID: 3338548644976901718} 108 | m_Enabled: 1 109 | m_Avatar: {fileID: 0} 110 | m_Controller: {fileID: 0} 111 | m_CullingMode: 0 112 | m_UpdateMode: 0 113 | m_ApplyRootMotion: 0 114 | m_LinearVelocityBlending: 0 115 | m_WarningMessage: 116 | m_HasTransformHierarchy: 1 117 | m_AllowConstantClipSamplingOptimization: 1 118 | m_KeepAnimatorControllerStateOnDisable: 0 119 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Skyboxes/Skybox_Bird_Night.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Skybox_Bird_Night 10 | m_Shader: {fileID: 106, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION _SUNDISK_HIGH_QUALITY 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - first: 74 | name: _AtmosphereThickness 75 | second: 0.11 76 | - first: 77 | name: _BumpScale 78 | second: 1 79 | - first: 80 | name: _Cutoff 81 | second: 0.5 82 | - first: 83 | name: _DetailNormalMapScale 84 | second: 1 85 | - first: 86 | name: _DstBlend 87 | second: 0 88 | - first: 89 | name: _Exposure 90 | second: 3.38 91 | - first: 92 | name: _GlossMapScale 93 | second: 1 94 | - first: 95 | name: _Glossiness 96 | second: 0.5 97 | - first: 98 | name: _GlossyReflections 99 | second: 1 100 | - first: 101 | name: _Metallic 102 | second: 0 103 | - first: 104 | name: _Mode 105 | second: 0 106 | - first: 107 | name: _OcclusionStrength 108 | second: 1 109 | - first: 110 | name: _Parallax 111 | second: 0.02 112 | - first: 113 | name: _SmoothnessTextureChannel 114 | second: 0 115 | - first: 116 | name: _SpecularHighlights 117 | second: 1 118 | - first: 119 | name: _SrcBlend 120 | second: 1 121 | - first: 122 | name: _SunDisk 123 | second: 2 124 | - first: 125 | name: _SunSize 126 | second: 0.033 127 | - first: 128 | name: _UVSec 129 | second: 0 130 | - first: 131 | name: _ZWrite 132 | second: 1 133 | m_Colors: 134 | - first: 135 | name: _Color 136 | second: {r: 1, g: 1, b: 1, a: 1} 137 | - first: 138 | name: _EmissionColor 139 | second: {r: 0, g: 0, b: 0, a: 1} 140 | - first: 141 | name: _GroundColor 142 | second: {r: 0, g: 0.11845846, b: 0.2352941, a: 1} 143 | - first: 144 | name: _SkyTint 145 | second: {r: 0.22794116, g: 0.6805274, b: 1, a: 1} 146 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Skyboxes/Skybox_Bird_Day.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Skybox_Bird_Day 10 | m_Shader: {fileID: 106, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION _SUNDISK_HIGH_QUALITY 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - first: 74 | name: _AtmosphereThickness 75 | second: 0.67 76 | - first: 77 | name: _BumpScale 78 | second: 1 79 | - first: 80 | name: _Cutoff 81 | second: 0.5 82 | - first: 83 | name: _DetailNormalMapScale 84 | second: 1 85 | - first: 86 | name: _DstBlend 87 | second: 0 88 | - first: 89 | name: _Exposure 90 | second: 2.23 91 | - first: 92 | name: _GlossMapScale 93 | second: 1 94 | - first: 95 | name: _Glossiness 96 | second: 0.5 97 | - first: 98 | name: _GlossyReflections 99 | second: 1 100 | - first: 101 | name: _Metallic 102 | second: 0 103 | - first: 104 | name: _Mode 105 | second: 0 106 | - first: 107 | name: _OcclusionStrength 108 | second: 1 109 | - first: 110 | name: _Parallax 111 | second: 0.02 112 | - first: 113 | name: _SmoothnessTextureChannel 114 | second: 0 115 | - first: 116 | name: _SpecularHighlights 117 | second: 1 118 | - first: 119 | name: _SrcBlend 120 | second: 1 121 | - first: 122 | name: _SunDisk 123 | second: 2 124 | - first: 125 | name: _SunSize 126 | second: 0.04 127 | - first: 128 | name: _UVSec 129 | second: 0 130 | - first: 131 | name: _ZWrite 132 | second: 1 133 | m_Colors: 134 | - first: 135 | name: _Color 136 | second: {r: 1, g: 1, b: 1, a: 1} 137 | - first: 138 | name: _EmissionColor 139 | second: {r: 0, g: 0, b: 0, a: 1} 140 | - first: 141 | name: _GroundColor 142 | second: {r: 0.077314034, g: 0.07925816, b: 0.08088237, a: 1} 143 | - first: 144 | name: _SkyTint 145 | second: {r: 0.22794116, g: 0.6805274, b: 1, a: 1} 146 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Sprites/Clouds.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd8c95cbb31aa24449e5d645df66db15 3 | TextureImporter: 4 | internalIDToNameTable: 5 | - first: 6 | 213: 21300000 7 | second: Cloud_01 8 | - first: 9 | 213: 21300002 10 | second: Cloud_02 11 | - first: 12 | 213: 21300004 13 | second: Cloud_03 14 | externalObjects: {} 15 | serializedVersion: 11 16 | mipmaps: 17 | mipMapMode: 0 18 | enableMipMap: 0 19 | sRGBTexture: 1 20 | linearTexture: 0 21 | fadeOut: 0 22 | borderMipMap: 0 23 | mipMapsPreserveCoverage: 0 24 | alphaTestReferenceValue: 0.5 25 | mipMapFadeDistanceStart: 1 26 | mipMapFadeDistanceEnd: 3 27 | bumpmap: 28 | convertToNormalMap: 0 29 | externalNormalMap: 0 30 | heightScale: 0.25 31 | normalMapFilter: 0 32 | isReadable: 0 33 | streamingMipmaps: 0 34 | streamingMipmapsPriority: 0 35 | vTOnly: 0 36 | grayScaleToAlpha: 0 37 | generateCubemap: 6 38 | cubemapConvolution: 0 39 | seamlessCubemap: 0 40 | textureFormat: 1 41 | maxTextureSize: 2048 42 | textureSettings: 43 | serializedVersion: 2 44 | filterMode: 1 45 | aniso: 1 46 | mipBias: 0 47 | wrapU: 1 48 | wrapV: 1 49 | wrapW: 1 50 | nPOTScale: 0 51 | lightmap: 0 52 | compressionQuality: 50 53 | spriteMode: 2 54 | spriteExtrude: 1 55 | spriteMeshType: 1 56 | alignment: 0 57 | spritePivot: {x: 0.5, y: 0.5} 58 | spritePixelsToUnits: 100 59 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 60 | spriteGenerateFallbackPhysicsShape: 1 61 | alphaUsage: 1 62 | alphaIsTransparency: 1 63 | spriteTessellationDetail: -1 64 | textureType: 8 65 | textureShape: 1 66 | singleChannelComponent: 0 67 | flipbookRows: 1 68 | flipbookColumns: 1 69 | maxTextureSizeSet: 0 70 | compressionQualitySet: 0 71 | textureFormatSet: 0 72 | ignorePngGamma: 0 73 | applyGammaDecoding: 1 74 | platformSettings: 75 | - serializedVersion: 3 76 | buildTarget: DefaultTexturePlatform 77 | maxTextureSize: 2048 78 | resizeAlgorithm: 0 79 | textureFormat: -1 80 | textureCompression: 1 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | androidETC2FallbackOverride: 0 86 | forceMaximumCompressionQuality_BC6H_BC7: 1 87 | - serializedVersion: 3 88 | buildTarget: Standalone 89 | maxTextureSize: 2048 90 | resizeAlgorithm: 0 91 | textureFormat: -1 92 | textureCompression: 1 93 | compressionQuality: 50 94 | crunchedCompression: 0 95 | allowsAlphaSplitting: 0 96 | overridden: 0 97 | androidETC2FallbackOverride: 0 98 | forceMaximumCompressionQuality_BC6H_BC7: 1 99 | spriteSheet: 100 | serializedVersion: 2 101 | sprites: 102 | - serializedVersion: 2 103 | name: Cloud_01 104 | rect: 105 | serializedVersion: 2 106 | x: 0 107 | y: 1494 108 | width: 2048 109 | height: 554 110 | alignment: 0 111 | pivot: {x: 0.5, y: 0.5} 112 | border: {x: 0, y: 0, z: 0, w: 0} 113 | outline: [] 114 | physicsShape: [] 115 | tessellationDetail: 0 116 | bones: [] 117 | spriteID: 02305410000000000800000000000000 118 | internalID: 21300000 119 | vertices: [] 120 | indices: 121 | edges: [] 122 | weights: [] 123 | - serializedVersion: 2 124 | name: Cloud_02 125 | rect: 126 | serializedVersion: 2 127 | x: 0 128 | y: 789 129 | width: 2048 130 | height: 723 131 | alignment: 0 132 | pivot: {x: 0.5, y: 0.5} 133 | border: {x: 0, y: 0, z: 0, w: 0} 134 | outline: [] 135 | physicsShape: [] 136 | tessellationDetail: 0 137 | bones: [] 138 | spriteID: 22305410000000000800000000000000 139 | internalID: 21300002 140 | vertices: [] 141 | indices: 142 | edges: [] 143 | weights: [] 144 | - serializedVersion: 2 145 | name: Cloud_03 146 | rect: 147 | serializedVersion: 2 148 | x: 0 149 | y: 0 150 | width: 2048 151 | height: 797 152 | alignment: 0 153 | pivot: {x: 0.5, y: 0.5} 154 | border: {x: 0, y: 0, z: 0, w: 0} 155 | outline: [] 156 | physicsShape: [] 157 | tessellationDetail: 0 158 | bones: [] 159 | spriteID: 42305410000000000800000000000000 160 | internalID: 21300004 161 | vertices: [] 162 | indices: 163 | edges: [] 164 | weights: [] 165 | outline: [] 166 | physicsShape: [] 167 | bones: [] 168 | spriteID: 169 | internalID: 0 170 | vertices: [] 171 | indices: 172 | edges: [] 173 | weights: [] 174 | secondaryTextures: [] 175 | spritePackingTag: 176 | pSDRemoveMatte: 1 177 | pSDShowRemoveMatteOption: 1 178 | userData: 179 | assetBundleName: 180 | assetBundleVariant: 181 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Scripts/FlockManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace TornadoBanditsStudio.LowPolyBird 6 | { 7 | /// 8 | /// Flock manager class. 9 | /// 10 | public class FlockManager : MonoBehaviour 11 | { 12 | [Header ("Spawm Settings")] 13 | public List birdsPrefab = new List (); //Birds prefabs 14 | public int birdsNumber = 10; //Birds number 15 | public Vector3 spawnMiddlePoint = Vector3.zero; //Spawn middle point 16 | public Vector3 spawnBoundaries = Vector3.one; //Span boundaries 17 | public List spawnedBirds; //A list with the flock 18 | 19 | public bool enableRandomScale = true; //Enable random scale 20 | public float minScale = 0.8f; //Min scale 21 | public float maxScale = 1.2f; //Max scale 22 | 23 | private GameObject flockParent; //Just to keep the the birds in a single parent 24 | 25 | [Space (15)] 26 | [Header ("Flock Target Settings")] 27 | public Vector3 flockTargetPosition = Vector3.zero; //target of flock 28 | public float minDistanceToTarget = 2f; //the min distance between target and flock birds 29 | private float initialDistance; //Initial distance 30 | public Vector3 flockTargetBoxMiddlePoint = Vector3.zero; //the middle point of the flock target might go 31 | public Vector3 flockTargetBoxSize = new Vector3 (25, 25, 25); //the box where the flock target might be 32 | 33 | /// 34 | /// Unity Start function. 35 | /// 36 | private void Start () 37 | { 38 | //Make sure that the birds prefab list is not null 39 | for (int i=0; i 85 | /// Get a random position based on the boundaries set. 86 | /// 87 | /// Random position in boundaries. 88 | private Vector3 GetRandomPosition (Vector3 center, Vector3 boundaries) 89 | { 90 | //Set a random position. 91 | //We are spawning based on the middle point set in inspector and the boundaries of spawning. 92 | return center + new Vector3 (Random.Range (-boundaries.x, boundaries.x), Random.Range (-boundaries.y, boundaries.y), Random.Range (-boundaries.z, boundaries.z)) / 2; 93 | } 94 | 95 | /// 96 | /// Modifies target position 97 | /// 98 | private void ChangeTargetPosition () 99 | { 100 | //Get a random position in our flock target box 101 | flockTargetPosition = GetRandomPosition (flockTargetBoxMiddlePoint, flockTargetBoxSize); 102 | //Set a random distance 103 | minDistanceToTarget = Random.Range (initialDistance - initialDistance / 2, initialDistance + initialDistance / 2); 104 | //Invoke this function again. 105 | Invoke ("ChangeTargetPosition", Random.Range (10, 15)); 106 | } 107 | 108 | /// 109 | /// On draw gizmos. 110 | /// 111 | private void OnDrawGizmos () 112 | { 113 | #if UNITY_EDITOR 114 | //Spawn settings visualised in the Editor 115 | Gizmos.color = Color.red; 116 | Gizmos.DrawWireCube (spawnMiddlePoint, spawnBoundaries); 117 | 118 | //Target box visualised in the Editor 119 | Gizmos.color = Color.green; 120 | Gizmos.DrawWireCube (flockTargetBoxMiddlePoint, flockTargetBoxSize); 121 | 122 | if (UnityEditor.EditorApplication.isPlaying == true) 123 | { 124 | Gizmos.color = Color.cyan; 125 | Gizmos.DrawSphere (flockTargetPosition, 0.1f); 126 | } 127 | #endif 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "ignore": false, 8 | "defaultInstantiationMode": 0, 9 | "supportsModification": true 10 | }, 11 | { 12 | "userAdded": false, 13 | "type": "UnityEditor.Animations.AnimatorController", 14 | "ignore": false, 15 | "defaultInstantiationMode": 0, 16 | "supportsModification": true 17 | }, 18 | { 19 | "userAdded": false, 20 | "type": "UnityEngine.AnimatorOverrideController", 21 | "ignore": false, 22 | "defaultInstantiationMode": 0, 23 | "supportsModification": true 24 | }, 25 | { 26 | "userAdded": false, 27 | "type": "UnityEditor.Audio.AudioMixerController", 28 | "ignore": false, 29 | "defaultInstantiationMode": 0, 30 | "supportsModification": true 31 | }, 32 | { 33 | "userAdded": false, 34 | "type": "UnityEngine.ComputeShader", 35 | "ignore": true, 36 | "defaultInstantiationMode": 1, 37 | "supportsModification": true 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEngine.Cubemap", 42 | "ignore": false, 43 | "defaultInstantiationMode": 0, 44 | "supportsModification": true 45 | }, 46 | { 47 | "userAdded": false, 48 | "type": "UnityEngine.GameObject", 49 | "ignore": false, 50 | "defaultInstantiationMode": 0, 51 | "supportsModification": true 52 | }, 53 | { 54 | "userAdded": false, 55 | "type": "UnityEditor.LightingDataAsset", 56 | "ignore": false, 57 | "defaultInstantiationMode": 0, 58 | "supportsModification": false 59 | }, 60 | { 61 | "userAdded": false, 62 | "type": "UnityEngine.LightingSettings", 63 | "ignore": false, 64 | "defaultInstantiationMode": 0, 65 | "supportsModification": true 66 | }, 67 | { 68 | "userAdded": false, 69 | "type": "UnityEngine.Material", 70 | "ignore": false, 71 | "defaultInstantiationMode": 0, 72 | "supportsModification": true 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEditor.MonoScript", 77 | "ignore": true, 78 | "defaultInstantiationMode": 1, 79 | "supportsModification": true 80 | }, 81 | { 82 | "userAdded": false, 83 | "type": "UnityEngine.PhysicMaterial", 84 | "ignore": false, 85 | "defaultInstantiationMode": 0, 86 | "supportsModification": true 87 | }, 88 | { 89 | "userAdded": false, 90 | "type": "UnityEngine.PhysicsMaterial2D", 91 | "ignore": false, 92 | "defaultInstantiationMode": 0, 93 | "supportsModification": true 94 | }, 95 | { 96 | "userAdded": false, 97 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 98 | "ignore": false, 99 | "defaultInstantiationMode": 0, 100 | "supportsModification": true 101 | }, 102 | { 103 | "userAdded": false, 104 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 105 | "ignore": false, 106 | "defaultInstantiationMode": 0, 107 | "supportsModification": true 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Rendering.VolumeProfile", 112 | "ignore": false, 113 | "defaultInstantiationMode": 0, 114 | "supportsModification": true 115 | }, 116 | { 117 | "userAdded": false, 118 | "type": "UnityEditor.SceneAsset", 119 | "ignore": false, 120 | "defaultInstantiationMode": 0, 121 | "supportsModification": false 122 | }, 123 | { 124 | "userAdded": false, 125 | "type": "UnityEngine.Shader", 126 | "ignore": true, 127 | "defaultInstantiationMode": 1, 128 | "supportsModification": true 129 | }, 130 | { 131 | "userAdded": false, 132 | "type": "UnityEngine.ShaderVariantCollection", 133 | "ignore": true, 134 | "defaultInstantiationMode": 1, 135 | "supportsModification": true 136 | }, 137 | { 138 | "userAdded": false, 139 | "type": "UnityEngine.Texture", 140 | "ignore": false, 141 | "defaultInstantiationMode": 0, 142 | "supportsModification": true 143 | }, 144 | { 145 | "userAdded": false, 146 | "type": "UnityEngine.Texture2D", 147 | "ignore": false, 148 | "defaultInstantiationMode": 0, 149 | "supportsModification": true 150 | }, 151 | { 152 | "userAdded": false, 153 | "type": "UnityEngine.Timeline.TimelineAsset", 154 | "ignore": false, 155 | "defaultInstantiationMode": 0, 156 | "supportsModification": true 157 | } 158 | ], 159 | "defaultDependencyTypeInfo": { 160 | "userAdded": false, 161 | "type": "", 162 | "ignore": false, 163 | "defaultInstantiationMode": 1, 164 | "supportsModification": true 165 | }, 166 | "newSceneOverride": 0 167 | } -------------------------------------------------------------------------------- /Assets/Unit Control/UnitControlSystem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using Unity.Collections; 4 | using Unity.Entities; 5 | using Unity.Mathematics; 6 | using Unity.Rendering; 7 | using Unity.Transforms; 8 | using UnityEngine; 9 | 10 | namespace UnitControl 11 | { 12 | public class UnitControlSystem : SystemBase 13 | { 14 | private float3 startPosition; 15 | protected override void OnUpdate() 16 | { 17 | if (Input.GetMouseButtonDown(0)) 18 | { 19 | SceneController.Instance?.SelectionArea.gameObject.SetActive(true); 20 | startPosition = MousePositionUtils.MouseToTerrainPositionECS(); 21 | SceneController.Instance?.SetSelectionAreaPosition(startPosition); 22 | } 23 | 24 | if (Input.GetMouseButton(0)) 25 | { 26 | var selectionAreaSize = MousePositionUtils.MouseToTerrainPositionECS() - startPosition; 27 | SceneController.Instance?.SetSelectionAreaScale(selectionAreaSize); 28 | } 29 | 30 | if (Input.GetMouseButtonUp(0)) 31 | { 32 | SceneController.Instance?.SelectionArea.gameObject.SetActive(false); 33 | 34 | var endPosition = MousePositionUtils.MouseToTerrainPositionECS(); 35 | var lowerLeftPosition = new float3(math.min(startPosition.x, endPosition.x), 36 | 0, 37 | math.min(startPosition.z, endPosition.z)); 38 | var upperRightPosition = new float3(math.max(startPosition.x, endPosition.x), 39 | 0, 40 | math.max(startPosition.z, endPosition.z)); 41 | 42 | // Implement click select 43 | var selectionMinSize = 2f; 44 | var singleSelect = false; 45 | var selectEntitiesCount = 0; 46 | var selectionAreaSize = math.distance(lowerLeftPosition, upperRightPosition); 47 | if (selectionAreaSize < selectionMinSize) 48 | { 49 | lowerLeftPosition += new float3(-1, 0, -1) * (selectionMinSize - selectionAreaSize) *.5f; 50 | upperRightPosition += new float3(1, 0, 1) * (selectionMinSize - selectionAreaSize) *.5f; 51 | singleSelect = true; 52 | } 53 | 54 | var ecb = new EntityCommandBuffer(Allocator.TempJob); 55 | 56 | // Deselect all selected entities 57 | Entities.WithAll().ForEach((Entity entity) => 58 | { 59 | ecb.RemoveComponent(entity); 60 | }).Run(); 61 | // Hide all select circles 62 | Entities.WithAll().ForEach((Entity entity) => 63 | { 64 | ecb.RemoveComponent(entity); 65 | ecb.RemoveComponent(entity); 66 | }).Run(); 67 | 68 | 69 | Entities 70 | .WithAll() 71 | .ForEach((Entity entity, in LocalToWorld localToWorld) => 72 | { 73 | if (singleSelect == false || selectEntitiesCount < 1) 74 | { 75 | var pos = localToWorld.Value.c3; 76 | if (pos.x >= lowerLeftPosition.x && pos.x <= upperRightPosition.x 77 | && pos.z >= lowerLeftPosition.z && pos.z <= upperRightPosition.z) 78 | { 79 | ecb.AddComponent(entity); 80 | selectEntitiesCount++; 81 | } 82 | } 83 | }).Run(); 84 | 85 | ecb.Playback(EntityManager); 86 | ecb.Dispose(); 87 | } 88 | 89 | if (Input.GetMouseButtonUp(1)) 90 | { 91 | var mousePosition = MousePositionUtils.MouseToTerrainPositionECS(); 92 | var selectedEntity = GetEntityQuery(ComponentType.ReadOnly()); 93 | int count = selectedEntity.CalculateEntityCount(); 94 | var movePositionList = GetPositionListAround(mousePosition, 1f, count); 95 | int positionIndex = 0; 96 | 97 | Entities 98 | .WithAll() 99 | .WithAll() 100 | .ForEach((Entity entity, ref MoveComponent moveComp, in Translation translation) => 101 | { 102 | moveComp.TargetPosition = new float3(movePositionList[positionIndex].x, 103 | translation.Value.y, 104 | movePositionList[positionIndex].z); 105 | moveComp.IsMoving = true; 106 | positionIndex++; 107 | }).Run(); 108 | } 109 | } 110 | 111 | private NativeArray GetPositionListAround(float3 startPosition, float distance, int positionCount) 112 | { 113 | var positionList = new NativeArray(positionCount, Allocator.Temp); 114 | positionList[0] = startPosition; 115 | for (int i = 1; i < positionCount; i++) 116 | { 117 | int angle = i * (360 / positionCount); 118 | var dir = ApplyRotationToVector(new float3(0, 0, 1), angle); 119 | var position = startPosition + dir * distance; 120 | positionList[i] = position; 121 | } 122 | return positionList; 123 | } 124 | 125 | private float3 ApplyRotationToVector(float3 vec, float angle) 126 | { 127 | return Quaternion.Euler(0, angle, 0) * vec; 128 | } 129 | } 130 | } -------------------------------------------------------------------------------- /Assets/Boids/2)ECS+Jobs/BoidSystem.cs: -------------------------------------------------------------------------------- 1 | using Unity.Burst; 2 | using Unity.Collections; 3 | using Unity.Collections.LowLevel.Unsafe; 4 | using Unity.Entities; 5 | using Unity.Jobs; 6 | using Unity.Mathematics; 7 | using Unity.Transforms; 8 | 9 | namespace Boid.ECS 10 | { 11 | public class BoidSystem : SystemBase 12 | { 13 | [BurstCompile] 14 | private struct CalcutateForce : IJobParallelFor 15 | { 16 | //[DeallocateOnJobCompletion] 17 | [NativeDisableParallelForRestriction] 18 | [ReadOnly] 19 | public NativeArray BoidsArray; 20 | [ReadOnly] 21 | public float deltaTime; 22 | [ReadOnly] 23 | public Boid Boid; 24 | 25 | [NativeDisableContainerSafetyRestriction] 26 | [WriteOnly] 27 | public ComponentDataFromEntity TranslationFromEntity; 28 | [NativeDisableContainerSafetyRestriction] 29 | [WriteOnly] 30 | public ComponentDataFromEntity RotationFromEntity; 31 | 32 | public void Execute(int index) 33 | { 34 | var entity = BoidsArray[index].Entity; 35 | var boidPosition = BoidsArray[index].LocalToWorld.Position; 36 | 37 | var seperationSum = float3.zero; 38 | var positionSum = float3.zero; 39 | var headingSum = float3.zero; 40 | 41 | int boidsNearby = 0; 42 | 43 | for (int i = 0; i < BoidsArray.Length; i++) 44 | { 45 | if (entity != BoidsArray[i].Entity) 46 | { 47 | var otherBoidsPosition = BoidsArray[i].LocalToWorld.Position; 48 | var distToOtherBoid = math.length(boidPosition - otherBoidsPosition); 49 | 50 | if (distToOtherBoid < Boid.CellRadius) 51 | { 52 | seperationSum += -(otherBoidsPosition - boidPosition) * (1f / math.max(distToOtherBoid, .0001f)); 53 | positionSum += otherBoidsPosition; 54 | headingSum += BoidsArray[i].LocalToWorld.Forward; 55 | boidsNearby++; 56 | } 57 | } 58 | } 59 | 60 | var separationForce = float3.zero; 61 | var cohesionForce = float3.zero; 62 | var alignmentForce = float3.zero; 63 | var avoidWallsForce = float3.zero; 64 | if (boidsNearby > 0) 65 | { 66 | separationForce = seperationSum / boidsNearby; 67 | cohesionForce = (positionSum / boidsNearby) - boidPosition; 68 | alignmentForce = headingSum / boidsNearby; 69 | } 70 | if (math.min(math.min((500 / 2f) - math.abs(boidPosition.x), 71 | (500 / 2f) - math.abs(boidPosition.y)), 72 | (500 / 2f) - math.abs(boidPosition.z)) < Boid.AvoidWallTurnDistance) 73 | { 74 | avoidWallsForce = -math.normalize(boidPosition); 75 | } 76 | 77 | var force = separationForce * Boid.SeparationWeight + 78 | cohesionForce * Boid.CohesionWeight + 79 | alignmentForce * Boid.AlighmentWeight + 80 | avoidWallsForce * Boid.AvoidWallsWeight; 81 | var velocity = BoidsArray[index].LocalToWorld.Forward * Boid.MoveSpeed; 82 | velocity += force * deltaTime; 83 | velocity = math.normalize(velocity) * Boid.MoveSpeed; 84 | 85 | 86 | var translation = new Translation { Value = BoidsArray[index].LocalToWorld.Position + velocity * deltaTime }; 87 | var rotation = new Rotation { Value = quaternion.LookRotationSafe(velocity, BoidsArray[index].LocalToWorld.Up) }; 88 | TranslationFromEntity[entity] = translation; 89 | RotationFromEntity[entity] = rotation; 90 | } 91 | } 92 | 93 | private struct EntityWithLocalToWorld 94 | { 95 | public Entity Entity; 96 | public LocalToWorld LocalToWorld; 97 | } 98 | 99 | 100 | protected override void OnUpdate() 101 | { 102 | var dt = Time.DeltaTime; 103 | var boidsQuery = GetEntityQuery(ComponentType.ReadOnly(), ComponentType.ReadOnly()); 104 | var entitiesArray = boidsQuery.ToEntityArray(Allocator.TempJob); 105 | var localToWorldArray = boidsQuery.ToComponentDataArray(Allocator.TempJob); 106 | var boidsArray = new NativeArray(entitiesArray.Length, Allocator.TempJob); 107 | for (int i = 0; i < entitiesArray.Length; i++) 108 | { 109 | boidsArray[i] = new EntityWithLocalToWorld 110 | { 111 | Entity = entitiesArray[i], 112 | LocalToWorld = localToWorldArray[i] 113 | }; 114 | } 115 | entitiesArray.Dispose(); 116 | localToWorldArray.Dispose(); 117 | 118 | Entities 119 | .WithStructuralChanges() 120 | .WithName("BoidSystem") 121 | .ForEach((Boid boid) => 122 | { 123 | 124 | var translationFromEntity = GetComponentDataFromEntity(); 125 | var rotationFromEntity = GetComponentDataFromEntity(); 126 | 127 | var calcutateForceJob = new CalcutateForce 128 | { 129 | TranslationFromEntity = translationFromEntity, 130 | RotationFromEntity = rotationFromEntity, 131 | Boid = boid, 132 | BoidsArray = boidsArray, 133 | deltaTime = dt 134 | }; 135 | calcutateForceJob.Schedule(boidsArray.Length, 64, Dependency).Complete(); 136 | if (boidsArray.Length > 0) 137 | { 138 | boidsArray.Dispose(); 139 | } 140 | }).Run(); 141 | 142 | } 143 | } 144 | } -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Stadia: 5 227 | Standalone: 5 228 | WebGL: 3 229 | Windows Store Apps: 5 230 | XboxOne: 5 231 | iPhone: 2 232 | tvOS: 2 233 | -------------------------------------------------------------------------------- /Assets/Unit Control/PrefabGameObject.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &1651553659440244280 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 2369735261022381878} 12 | - component: {fileID: 5848173645864419721} 13 | - component: {fileID: 2140448833669365512} 14 | - component: {fileID: 3489065200947538269} 15 | - component: {fileID: 3003518519259963796} 16 | - component: {fileID: 8873679311360764588} 17 | m_Layer: 0 18 | m_Name: Quad 19 | m_TagString: Untagged 20 | m_Icon: {fileID: 0} 21 | m_NavMeshLayer: 0 22 | m_StaticEditorFlags: 0 23 | m_IsActive: 1 24 | --- !u!4 &2369735261022381878 25 | Transform: 26 | m_ObjectHideFlags: 0 27 | m_CorrespondingSourceObject: {fileID: 0} 28 | m_PrefabInstance: {fileID: 0} 29 | m_PrefabAsset: {fileID: 0} 30 | m_GameObject: {fileID: 1651553659440244280} 31 | m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} 32 | m_LocalPosition: {x: 0, y: -1, z: 0} 33 | m_LocalScale: {x: 2, y: 2, z: 1} 34 | m_Children: [] 35 | m_Father: {fileID: 3338548644976901714} 36 | m_RootOrder: 0 37 | m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} 38 | --- !u!33 &5848173645864419721 39 | MeshFilter: 40 | m_ObjectHideFlags: 0 41 | m_CorrespondingSourceObject: {fileID: 0} 42 | m_PrefabInstance: {fileID: 0} 43 | m_PrefabAsset: {fileID: 0} 44 | m_GameObject: {fileID: 1651553659440244280} 45 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 46 | --- !u!23 &2140448833669365512 47 | MeshRenderer: 48 | m_ObjectHideFlags: 0 49 | m_CorrespondingSourceObject: {fileID: 0} 50 | m_PrefabInstance: {fileID: 0} 51 | m_PrefabAsset: {fileID: 0} 52 | m_GameObject: {fileID: 1651553659440244280} 53 | m_Enabled: 1 54 | m_CastShadows: 1 55 | m_ReceiveShadows: 1 56 | m_DynamicOccludee: 1 57 | m_MotionVectors: 1 58 | m_LightProbeUsage: 1 59 | m_ReflectionProbeUsage: 1 60 | m_RayTracingMode: 2 61 | m_RayTraceProcedural: 0 62 | m_RenderingLayerMask: 1 63 | m_RendererPriority: 0 64 | m_Materials: 65 | - {fileID: 2100000, guid: 09cb8a5b4fbee594aa14a99a296957fc, type: 2} 66 | m_StaticBatchInfo: 67 | firstSubMesh: 0 68 | subMeshCount: 0 69 | m_StaticBatchRoot: {fileID: 0} 70 | m_ProbeAnchor: {fileID: 0} 71 | m_LightProbeVolumeOverride: {fileID: 0} 72 | m_ScaleInLightmap: 1 73 | m_ReceiveGI: 1 74 | m_PreserveUVs: 0 75 | m_IgnoreNormalsForChartDetection: 0 76 | m_ImportantGI: 0 77 | m_StitchLightmapSeams: 1 78 | m_SelectedEditorRenderState: 3 79 | m_MinimumChartSize: 4 80 | m_AutoUVMaxDistance: 0.5 81 | m_AutoUVMaxAngle: 89 82 | m_LightmapParameters: {fileID: 0} 83 | m_SortingLayerID: 0 84 | m_SortingLayer: 0 85 | m_SortingOrder: 0 86 | m_AdditionalVertexStreams: {fileID: 0} 87 | --- !u!64 &3489065200947538269 88 | MeshCollider: 89 | m_ObjectHideFlags: 0 90 | m_CorrespondingSourceObject: {fileID: 0} 91 | m_PrefabInstance: {fileID: 0} 92 | m_PrefabAsset: {fileID: 0} 93 | m_GameObject: {fileID: 1651553659440244280} 94 | m_Material: {fileID: 0} 95 | m_IsTrigger: 0 96 | m_Enabled: 1 97 | serializedVersion: 4 98 | m_Convex: 0 99 | m_CookingOptions: 30 100 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 101 | --- !u!114 &3003518519259963796 102 | MonoBehaviour: 103 | m_ObjectHideFlags: 0 104 | m_CorrespondingSourceObject: {fileID: 0} 105 | m_PrefabInstance: {fileID: 0} 106 | m_PrefabAsset: {fileID: 0} 107 | m_GameObject: {fileID: 1651553659440244280} 108 | m_Enabled: 1 109 | m_EditorHideFlags: 0 110 | m_Script: {fileID: 11500000, guid: 4af4e930556ff044cb5ac3ae8092a195, type: 3} 111 | m_Name: 112 | m_EditorClassIdentifier: 113 | --- !u!114 &8873679311360764588 114 | MonoBehaviour: 115 | m_ObjectHideFlags: 0 116 | m_CorrespondingSourceObject: {fileID: 0} 117 | m_PrefabInstance: {fileID: 0} 118 | m_PrefabAsset: {fileID: 0} 119 | m_GameObject: {fileID: 1651553659440244280} 120 | m_Enabled: 1 121 | m_EditorHideFlags: 0 122 | m_Script: {fileID: 11500000, guid: 48884bc91064b784ab424fa47fa3764e, type: 3} 123 | m_Name: 124 | m_EditorClassIdentifier: 125 | --- !u!1 &3338548644976901718 126 | GameObject: 127 | m_ObjectHideFlags: 0 128 | m_CorrespondingSourceObject: {fileID: 0} 129 | m_PrefabInstance: {fileID: 0} 130 | m_PrefabAsset: {fileID: 0} 131 | serializedVersion: 6 132 | m_Component: 133 | - component: {fileID: 3338548644976901714} 134 | - component: {fileID: 3338548644976901717} 135 | - component: {fileID: 3338548644976901716} 136 | - component: {fileID: 2048266032614007455} 137 | - component: {fileID: 1898458292445742314} 138 | m_Layer: 0 139 | m_Name: PrefabGameObject 140 | m_TagString: Untagged 141 | m_Icon: {fileID: 0} 142 | m_NavMeshLayer: 0 143 | m_StaticEditorFlags: 0 144 | m_IsActive: 1 145 | --- !u!4 &3338548644976901714 146 | Transform: 147 | m_ObjectHideFlags: 0 148 | m_CorrespondingSourceObject: {fileID: 0} 149 | m_PrefabInstance: {fileID: 0} 150 | m_PrefabAsset: {fileID: 0} 151 | m_GameObject: {fileID: 3338548644976901718} 152 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 153 | m_LocalPosition: {x: 0, y: 0, z: 0} 154 | m_LocalScale: {x: 1, y: 1, z: 1} 155 | m_Children: 156 | - {fileID: 2369735261022381878} 157 | m_Father: {fileID: 0} 158 | m_RootOrder: 0 159 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 160 | --- !u!33 &3338548644976901717 161 | MeshFilter: 162 | m_ObjectHideFlags: 0 163 | m_CorrespondingSourceObject: {fileID: 0} 164 | m_PrefabInstance: {fileID: 0} 165 | m_PrefabAsset: {fileID: 0} 166 | m_GameObject: {fileID: 3338548644976901718} 167 | m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} 168 | --- !u!23 &3338548644976901716 169 | MeshRenderer: 170 | m_ObjectHideFlags: 0 171 | m_CorrespondingSourceObject: {fileID: 0} 172 | m_PrefabInstance: {fileID: 0} 173 | m_PrefabAsset: {fileID: 0} 174 | m_GameObject: {fileID: 3338548644976901718} 175 | m_Enabled: 1 176 | m_CastShadows: 1 177 | m_ReceiveShadows: 1 178 | m_DynamicOccludee: 1 179 | m_MotionVectors: 1 180 | m_LightProbeUsage: 1 181 | m_ReflectionProbeUsage: 1 182 | m_RayTracingMode: 2 183 | m_RayTraceProcedural: 0 184 | m_RenderingLayerMask: 1 185 | m_RendererPriority: 0 186 | m_Materials: 187 | - {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0} 188 | m_StaticBatchInfo: 189 | firstSubMesh: 0 190 | subMeshCount: 0 191 | m_StaticBatchRoot: {fileID: 0} 192 | m_ProbeAnchor: {fileID: 0} 193 | m_LightProbeVolumeOverride: {fileID: 0} 194 | m_ScaleInLightmap: 1 195 | m_ReceiveGI: 1 196 | m_PreserveUVs: 0 197 | m_IgnoreNormalsForChartDetection: 0 198 | m_ImportantGI: 0 199 | m_StitchLightmapSeams: 1 200 | m_SelectedEditorRenderState: 3 201 | m_MinimumChartSize: 4 202 | m_AutoUVMaxDistance: 0.5 203 | m_AutoUVMaxAngle: 89 204 | m_LightmapParameters: {fileID: 0} 205 | m_SortingLayerID: 0 206 | m_SortingLayer: 0 207 | m_SortingOrder: 0 208 | m_AdditionalVertexStreams: {fileID: 0} 209 | --- !u!95 &2048266032614007455 210 | Animator: 211 | serializedVersion: 3 212 | m_ObjectHideFlags: 0 213 | m_CorrespondingSourceObject: {fileID: 0} 214 | m_PrefabInstance: {fileID: 0} 215 | m_PrefabAsset: {fileID: 0} 216 | m_GameObject: {fileID: 3338548644976901718} 217 | m_Enabled: 1 218 | m_Avatar: {fileID: 0} 219 | m_Controller: {fileID: 0} 220 | m_CullingMode: 0 221 | m_UpdateMode: 0 222 | m_ApplyRootMotion: 0 223 | m_LinearVelocityBlending: 0 224 | m_WarningMessage: 225 | m_HasTransformHierarchy: 1 226 | m_AllowConstantClipSamplingOptimization: 1 227 | m_KeepAnimatorControllerStateOnDisable: 0 228 | --- !u!114 &1898458292445742314 229 | MonoBehaviour: 230 | m_ObjectHideFlags: 0 231 | m_CorrespondingSourceObject: {fileID: 0} 232 | m_PrefabInstance: {fileID: 0} 233 | m_PrefabAsset: {fileID: 0} 234 | m_GameObject: {fileID: 3338548644976901718} 235 | m_Enabled: 1 236 | m_EditorHideFlags: 0 237 | m_Script: {fileID: 11500000, guid: 848b76eb86649cc499a3a9ec4e631cd6, type: 3} 238 | m_Name: 239 | m_EditorClassIdentifier: 240 | IsMoving: 0 241 | TargetPosition: 242 | x: 0 243 | y: 0 244 | z: 0 245 | LastMoveDirection: 246 | x: 0 247 | y: 0 248 | z: 0 249 | MoveSpeed: 10 250 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/DemoScenes/PostProcessingDay.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: 8a3bdb2cd68f901469e7cc149151eb49, type: 3} 12 | m_Name: PostProcessingDay 13 | m_EditorClassIdentifier: 14 | debugViews: 15 | m_Enabled: 1 16 | m_Settings: 17 | mode: 0 18 | depth: 19 | scale: 1 20 | motionVectors: 21 | sourceOpacity: 1 22 | motionImageOpacity: 0 23 | motionImageAmplitude: 16 24 | motionVectorsOpacity: 1 25 | motionVectorsResolution: 24 26 | motionVectorsAmplitude: 64 27 | fog: 28 | m_Enabled: 1 29 | m_Settings: 30 | excludeSkybox: 1 31 | antialiasing: 32 | m_Enabled: 1 33 | m_Settings: 34 | method: 0 35 | fxaaSettings: 36 | preset: 4 37 | taaSettings: 38 | jitterSpread: 0.75 39 | sharpen: 0.3 40 | stationaryBlending: 0.95 41 | motionBlending: 0.85 42 | ambientOcclusion: 43 | m_Enabled: 0 44 | m_Settings: 45 | intensity: 1 46 | radius: 0.3 47 | sampleCount: 10 48 | downsampling: 1 49 | forceForwardCompatibility: 0 50 | ambientOnly: 0 51 | highPrecision: 0 52 | screenSpaceReflection: 53 | m_Enabled: 0 54 | m_Settings: 55 | reflection: 56 | blendType: 0 57 | reflectionQuality: 2 58 | maxDistance: 100 59 | iterationCount: 256 60 | stepSize: 3 61 | widthModifier: 0.5 62 | reflectionBlur: 1 63 | reflectBackfaces: 0 64 | intensity: 65 | reflectionMultiplier: 1 66 | fadeDistance: 100 67 | fresnelFade: 1 68 | fresnelFadePower: 1 69 | screenEdgeMask: 70 | intensity: 0.03 71 | depthOfField: 72 | m_Enabled: 0 73 | m_Settings: 74 | focusDistance: 10 75 | aperture: 5.6 76 | focalLength: 50 77 | useCameraFov: 0 78 | kernelSize: 1 79 | motionBlur: 80 | m_Enabled: 1 81 | m_Settings: 82 | shutterAngle: 270 83 | sampleCount: 10 84 | frameBlending: 0 85 | eyeAdaptation: 86 | m_Enabled: 0 87 | m_Settings: 88 | lowPercent: 45 89 | highPercent: 95 90 | minLuminance: -5 91 | maxLuminance: 1 92 | keyValue: 0.25 93 | dynamicKeyValue: 1 94 | adaptationType: 0 95 | speedUp: 2 96 | speedDown: 1 97 | logMin: -8 98 | logMax: 4 99 | bloom: 100 | m_Enabled: 0 101 | m_Settings: 102 | bloom: 103 | intensity: 0.5 104 | threshold: 0.88 105 | softKnee: 0.009 106 | radius: 4 107 | antiFlicker: 0 108 | lensDirt: 109 | texture: {fileID: 0} 110 | intensity: 3 111 | colorGrading: 112 | m_Enabled: 0 113 | m_Settings: 114 | tonemapping: 115 | tonemapper: 2 116 | neutralBlackIn: 0.02 117 | neutralWhiteIn: 10 118 | neutralBlackOut: 0 119 | neutralWhiteOut: 10 120 | neutralWhiteLevel: 5.3 121 | neutralWhiteClip: 10 122 | basic: 123 | postExposure: 0 124 | temperature: 0 125 | tint: 0 126 | hueShift: 0 127 | saturation: 1 128 | contrast: 1 129 | channelMixer: 130 | red: {x: 1, y: 0, z: 0} 131 | green: {x: 0, y: 1, z: 0} 132 | blue: {x: 0, y: 0, z: 1} 133 | currentEditingChannel: 0 134 | colorWheels: 135 | mode: 1 136 | log: 137 | slope: {r: 1, g: 1, b: 1, a: 0} 138 | power: {r: 1, g: 1, b: 1, a: 0} 139 | offset: {r: 1, g: 1, b: 1, a: 0} 140 | linear: 141 | lift: {r: 0, g: 0, b: 0, a: 0} 142 | gamma: {r: 0, g: 0, b: 0, a: 0} 143 | gain: {r: 0, g: 0, b: 0, a: 0} 144 | curves: 145 | master: 146 | curve: 147 | serializedVersion: 2 148 | m_Curve: 149 | - serializedVersion: 2 150 | time: 0 151 | value: 0 152 | inSlope: 1 153 | outSlope: 1 154 | tangentMode: 0 155 | - serializedVersion: 2 156 | time: 1 157 | value: 1 158 | inSlope: 1 159 | outSlope: 1 160 | tangentMode: 0 161 | m_PreInfinity: 2 162 | m_PostInfinity: 2 163 | m_RotationOrder: 0 164 | m_Loop: 0 165 | m_ZeroValue: 0 166 | m_Range: 1 167 | red: 168 | curve: 169 | serializedVersion: 2 170 | m_Curve: 171 | - serializedVersion: 2 172 | time: 0 173 | value: 0 174 | inSlope: 1 175 | outSlope: 1 176 | tangentMode: 0 177 | - serializedVersion: 2 178 | time: 1 179 | value: 1 180 | inSlope: 1 181 | outSlope: 1 182 | tangentMode: 0 183 | m_PreInfinity: 2 184 | m_PostInfinity: 2 185 | m_RotationOrder: 4 186 | m_Loop: 0 187 | m_ZeroValue: 0 188 | m_Range: 1 189 | green: 190 | curve: 191 | serializedVersion: 2 192 | m_Curve: 193 | - serializedVersion: 2 194 | time: 0 195 | value: 0 196 | inSlope: 1 197 | outSlope: 1 198 | tangentMode: 0 199 | - serializedVersion: 2 200 | time: 1 201 | value: 1 202 | inSlope: 1 203 | outSlope: 1 204 | tangentMode: 0 205 | m_PreInfinity: 2 206 | m_PostInfinity: 2 207 | m_RotationOrder: 4 208 | m_Loop: 0 209 | m_ZeroValue: 0 210 | m_Range: 1 211 | blue: 212 | curve: 213 | serializedVersion: 2 214 | m_Curve: 215 | - serializedVersion: 2 216 | time: 0 217 | value: 0 218 | inSlope: 1 219 | outSlope: 1 220 | tangentMode: 0 221 | - serializedVersion: 2 222 | time: 1 223 | value: 1 224 | inSlope: 1 225 | outSlope: 1 226 | tangentMode: 0 227 | m_PreInfinity: 2 228 | m_PostInfinity: 2 229 | m_RotationOrder: 4 230 | m_Loop: 0 231 | m_ZeroValue: 0 232 | m_Range: 1 233 | hueVShue: 234 | curve: 235 | serializedVersion: 2 236 | m_Curve: [] 237 | m_PreInfinity: 2 238 | m_PostInfinity: 2 239 | m_RotationOrder: 4 240 | m_Loop: 1 241 | m_ZeroValue: 0.5 242 | m_Range: 1 243 | hueVSsat: 244 | curve: 245 | serializedVersion: 2 246 | m_Curve: [] 247 | m_PreInfinity: 2 248 | m_PostInfinity: 2 249 | m_RotationOrder: 4 250 | m_Loop: 1 251 | m_ZeroValue: 0.5 252 | m_Range: 1 253 | satVSsat: 254 | curve: 255 | serializedVersion: 2 256 | m_Curve: [] 257 | m_PreInfinity: 2 258 | m_PostInfinity: 2 259 | m_RotationOrder: 4 260 | m_Loop: 0 261 | m_ZeroValue: 0.5 262 | m_Range: 1 263 | lumVSsat: 264 | curve: 265 | serializedVersion: 2 266 | m_Curve: [] 267 | m_PreInfinity: 2 268 | m_PostInfinity: 2 269 | m_RotationOrder: 4 270 | m_Loop: 0 271 | m_ZeroValue: 0.5 272 | m_Range: 1 273 | e_CurrentEditingCurve: 0 274 | e_CurveY: 1 275 | e_CurveR: 0 276 | e_CurveG: 0 277 | e_CurveB: 0 278 | userLut: 279 | m_Enabled: 0 280 | m_Settings: 281 | lut: {fileID: 0} 282 | contribution: 1 283 | chromaticAberration: 284 | m_Enabled: 0 285 | m_Settings: 286 | spectralTexture: {fileID: 0} 287 | intensity: 0.1 288 | grain: 289 | m_Enabled: 0 290 | m_Settings: 291 | colored: 1 292 | intensity: 0.5 293 | size: 1 294 | luminanceContribution: 0.8 295 | vignette: 296 | m_Enabled: 0 297 | m_Settings: 298 | mode: 0 299 | color: {r: 0, g: 0, b: 0, a: 1} 300 | center: {x: 0.5, y: 0.5} 301 | intensity: 0.45 302 | smoothness: 0.2 303 | roundness: 1 304 | mask: {fileID: 0} 305 | opacity: 1 306 | rounded: 0 307 | dithering: 308 | m_Enabled: 0 309 | monitors: 310 | currentMonitorID: 0 311 | refreshOnPlay: 0 312 | histogramMode: 3 313 | waveformExposure: 0.12 314 | waveformY: 0 315 | waveformR: 1 316 | waveformG: 1 317 | waveformB: 1 318 | paradeExposure: 0.12 319 | vectorscopeExposure: 0.12 320 | vectorscopeShowBackground: 1 321 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/DemoScenes/PostProcessingNight.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: 8a3bdb2cd68f901469e7cc149151eb49, type: 3} 12 | m_Name: PostProcessingNight 13 | m_EditorClassIdentifier: 14 | debugViews: 15 | m_Enabled: 1 16 | m_Settings: 17 | mode: 0 18 | depth: 19 | scale: 1 20 | motionVectors: 21 | sourceOpacity: 1 22 | motionImageOpacity: 0 23 | motionImageAmplitude: 16 24 | motionVectorsOpacity: 1 25 | motionVectorsResolution: 24 26 | motionVectorsAmplitude: 64 27 | fog: 28 | m_Enabled: 1 29 | m_Settings: 30 | excludeSkybox: 1 31 | antialiasing: 32 | m_Enabled: 1 33 | m_Settings: 34 | method: 0 35 | fxaaSettings: 36 | preset: 4 37 | taaSettings: 38 | jitterSpread: 0.75 39 | sharpen: 0.3 40 | stationaryBlending: 0.95 41 | motionBlending: 0.85 42 | ambientOcclusion: 43 | m_Enabled: 0 44 | m_Settings: 45 | intensity: 1 46 | radius: 0.3 47 | sampleCount: 10 48 | downsampling: 1 49 | forceForwardCompatibility: 0 50 | ambientOnly: 0 51 | highPrecision: 0 52 | screenSpaceReflection: 53 | m_Enabled: 0 54 | m_Settings: 55 | reflection: 56 | blendType: 0 57 | reflectionQuality: 2 58 | maxDistance: 100 59 | iterationCount: 256 60 | stepSize: 3 61 | widthModifier: 0.5 62 | reflectionBlur: 1 63 | reflectBackfaces: 0 64 | intensity: 65 | reflectionMultiplier: 1 66 | fadeDistance: 100 67 | fresnelFade: 1 68 | fresnelFadePower: 1 69 | screenEdgeMask: 70 | intensity: 0.03 71 | depthOfField: 72 | m_Enabled: 1 73 | m_Settings: 74 | focusDistance: 10 75 | aperture: 5.6 76 | focalLength: 50 77 | useCameraFov: 0 78 | kernelSize: 1 79 | motionBlur: 80 | m_Enabled: 1 81 | m_Settings: 82 | shutterAngle: 270 83 | sampleCount: 10 84 | frameBlending: 0 85 | eyeAdaptation: 86 | m_Enabled: 0 87 | m_Settings: 88 | lowPercent: 45 89 | highPercent: 95 90 | minLuminance: -5 91 | maxLuminance: 1 92 | keyValue: 0.25 93 | dynamicKeyValue: 1 94 | adaptationType: 0 95 | speedUp: 2 96 | speedDown: 1 97 | logMin: -8 98 | logMax: 4 99 | bloom: 100 | m_Enabled: 1 101 | m_Settings: 102 | bloom: 103 | intensity: 0.41 104 | threshold: 0.58 105 | softKnee: 0.166 106 | radius: 3.83 107 | antiFlicker: 1 108 | lensDirt: 109 | texture: {fileID: 0} 110 | intensity: 3 111 | colorGrading: 112 | m_Enabled: 0 113 | m_Settings: 114 | tonemapping: 115 | tonemapper: 1 116 | neutralBlackIn: 0.02 117 | neutralWhiteIn: 10 118 | neutralBlackOut: 0 119 | neutralWhiteOut: 10 120 | neutralWhiteLevel: 5.3 121 | neutralWhiteClip: 10 122 | basic: 123 | postExposure: 1.19 124 | temperature: 0 125 | tint: 0 126 | hueShift: 0 127 | saturation: 1 128 | contrast: 1 129 | channelMixer: 130 | red: {x: 1, y: 0, z: 0} 131 | green: {x: 0, y: 1, z: 0} 132 | blue: {x: 0, y: 0, z: 1} 133 | currentEditingChannel: 0 134 | colorWheels: 135 | mode: 1 136 | log: 137 | slope: {r: 1, g: 1, b: 1, a: 0} 138 | power: {r: 1, g: 1, b: 1, a: 0} 139 | offset: {r: 1, g: 1, b: 1, a: 0} 140 | linear: 141 | lift: {r: 0, g: 0, b: 0, a: 0} 142 | gamma: {r: 0, g: 0, b: 0, a: 0} 143 | gain: {r: 0, g: 0, b: 0, a: 0} 144 | curves: 145 | master: 146 | curve: 147 | serializedVersion: 2 148 | m_Curve: 149 | - serializedVersion: 2 150 | time: 0 151 | value: 0 152 | inSlope: 1 153 | outSlope: 1 154 | tangentMode: 0 155 | - serializedVersion: 2 156 | time: 1 157 | value: 1 158 | inSlope: 1 159 | outSlope: 1 160 | tangentMode: 0 161 | m_PreInfinity: 2 162 | m_PostInfinity: 2 163 | m_RotationOrder: 0 164 | m_Loop: 0 165 | m_ZeroValue: 0 166 | m_Range: 1 167 | red: 168 | curve: 169 | serializedVersion: 2 170 | m_Curve: 171 | - serializedVersion: 2 172 | time: 0 173 | value: 0 174 | inSlope: 1 175 | outSlope: 1 176 | tangentMode: 0 177 | - serializedVersion: 2 178 | time: 1 179 | value: 1 180 | inSlope: 1 181 | outSlope: 1 182 | tangentMode: 0 183 | m_PreInfinity: 2 184 | m_PostInfinity: 2 185 | m_RotationOrder: 4 186 | m_Loop: 0 187 | m_ZeroValue: 0 188 | m_Range: 1 189 | green: 190 | curve: 191 | serializedVersion: 2 192 | m_Curve: 193 | - serializedVersion: 2 194 | time: 0 195 | value: 0 196 | inSlope: 1 197 | outSlope: 1 198 | tangentMode: 0 199 | - serializedVersion: 2 200 | time: 1 201 | value: 1 202 | inSlope: 1 203 | outSlope: 1 204 | tangentMode: 0 205 | m_PreInfinity: 2 206 | m_PostInfinity: 2 207 | m_RotationOrder: 4 208 | m_Loop: 0 209 | m_ZeroValue: 0 210 | m_Range: 1 211 | blue: 212 | curve: 213 | serializedVersion: 2 214 | m_Curve: 215 | - serializedVersion: 2 216 | time: 0 217 | value: 0 218 | inSlope: 1 219 | outSlope: 1 220 | tangentMode: 0 221 | - serializedVersion: 2 222 | time: 1 223 | value: 1 224 | inSlope: 1 225 | outSlope: 1 226 | tangentMode: 0 227 | m_PreInfinity: 2 228 | m_PostInfinity: 2 229 | m_RotationOrder: 4 230 | m_Loop: 0 231 | m_ZeroValue: 0 232 | m_Range: 1 233 | hueVShue: 234 | curve: 235 | serializedVersion: 2 236 | m_Curve: [] 237 | m_PreInfinity: 2 238 | m_PostInfinity: 2 239 | m_RotationOrder: 4 240 | m_Loop: 1 241 | m_ZeroValue: 0.5 242 | m_Range: 1 243 | hueVSsat: 244 | curve: 245 | serializedVersion: 2 246 | m_Curve: [] 247 | m_PreInfinity: 2 248 | m_PostInfinity: 2 249 | m_RotationOrder: 4 250 | m_Loop: 1 251 | m_ZeroValue: 0.5 252 | m_Range: 1 253 | satVSsat: 254 | curve: 255 | serializedVersion: 2 256 | m_Curve: [] 257 | m_PreInfinity: 2 258 | m_PostInfinity: 2 259 | m_RotationOrder: 4 260 | m_Loop: 0 261 | m_ZeroValue: 0.5 262 | m_Range: 1 263 | lumVSsat: 264 | curve: 265 | serializedVersion: 2 266 | m_Curve: [] 267 | m_PreInfinity: 2 268 | m_PostInfinity: 2 269 | m_RotationOrder: 4 270 | m_Loop: 0 271 | m_ZeroValue: 0.5 272 | m_Range: 1 273 | e_CurrentEditingCurve: 0 274 | e_CurveY: 1 275 | e_CurveR: 0 276 | e_CurveG: 0 277 | e_CurveB: 0 278 | userLut: 279 | m_Enabled: 0 280 | m_Settings: 281 | lut: {fileID: 0} 282 | contribution: 1 283 | chromaticAberration: 284 | m_Enabled: 0 285 | m_Settings: 286 | spectralTexture: {fileID: 0} 287 | intensity: 0.1 288 | grain: 289 | m_Enabled: 0 290 | m_Settings: 291 | colored: 1 292 | intensity: 0.5 293 | size: 1 294 | luminanceContribution: 0.8 295 | vignette: 296 | m_Enabled: 1 297 | m_Settings: 298 | mode: 0 299 | color: {r: 0, g: 0, b: 0, a: 1} 300 | center: {x: 0.5, y: 0.5} 301 | intensity: 0.45 302 | smoothness: 0.2 303 | roundness: 1 304 | mask: {fileID: 0} 305 | opacity: 1 306 | rounded: 0 307 | dithering: 308 | m_Enabled: 0 309 | monitors: 310 | currentMonitorID: 0 311 | refreshOnPlay: 0 312 | histogramMode: 3 313 | waveformExposure: 0.12 314 | waveformY: 0 315 | waveformR: 1 316 | waveformG: 1 317 | waveformB: 1 318 | paradeExposure: 0.12 319 | vectorscopeExposure: 0.12 320 | vectorscopeShowBackground: 1 321 | -------------------------------------------------------------------------------- /Assets/Boids/Art Assets/TornadoBanditsStudio/Low Poly Background Bird/Scripts/Bird.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace TornadoBanditsStudio.LowPolyBird 6 | { 7 | /// 8 | /// Bird class. 9 | /// 10 | public class Bird : MonoBehaviour 11 | { 12 | [Header ("Wings Settings")] 13 | public Transform leftWing; //Left wing 14 | public Transform rightWing; //Right wing 15 | 16 | [Range (1, 60)] 17 | public float wingAngle = 30; //Wing angle to reach before going back to 0 18 | 19 | public float currentWingsRotationSpeed = 3; //the current wings rotation speed 20 | public float minWingsRotationSpeed = 240; //min wings rotation speed 21 | public float maxWingsRotationSpeed = 320; //max wings rotation speed 22 | 23 | private bool rotateWingsBack; //is rotating wings back from the wing angle to 0 24 | 25 | [Space (15)] 26 | [Header ("Movement Settings")] 27 | public float minSpeed = 0.5f; //min speed 28 | public float maxSpeed = 1.5f; //max speed 29 | public float currentSpeed; //The speed chosen 30 | 31 | public float currentRotationSpeed; //current rotation speed, chose between min and max rotation 32 | public float minRotationSpeed = 0.1f; //min rotation speed 33 | public float maxRotationSpeed = 0.5f; //max rotation speed 34 | 35 | public bool enableGliding = true; //Would you like to make the bird plan when it goes down? 36 | 37 | 38 | [Space (15)] 39 | [Header ("Flock settings")] 40 | public bool isPartOfFlock = false; //Is this bird part of a flock? 41 | public FlockManager flockManager; //reference to flock manager 42 | public bool turningToTarget = false; //is the bird rotating to the target 43 | public bool isGliding = false; 44 | 45 | 46 | 47 | /// 48 | /// Unity Start function. 49 | /// 50 | private void Start () 51 | { 52 | //Set a random movement speed 53 | ChangeCurrentSpeed (); 54 | 55 | //We are starning with the wings at 0, 0, 0 euler angles. 56 | rightWing.transform.localEulerAngles = leftWing.transform.localEulerAngles = Vector3.zero; 57 | //We will start by rotating it to the chosen angle. 58 | //When we hit the chosen angle we will go back 0 59 | rotateWingsBack = false; 60 | //Get a random rotation speed. 61 | currentWingsRotationSpeed = Mathf.Abs (Random.Range (minWingsRotationSpeed, maxWingsRotationSpeed)); 62 | //Set a random rotation speed between the chosen values 63 | currentRotationSpeed = Random.Range (minRotationSpeed, maxRotationSpeed); 64 | } 65 | 66 | /// 67 | /// Unity Update function. 68 | /// 69 | private void Update () 70 | { 71 | //If this is used as a part of a flock 72 | if (isPartOfFlock) 73 | { 74 | //If we are far away to the target then turn to the target 75 | turningToTarget = (Vector3.Distance (transform.position, flockManager.flockTargetPosition) >= flockManager.minDistanceToTarget) ? true : false; 76 | 77 | //Turn to the target 78 | if (turningToTarget) 79 | { 80 | Vector3 dir = flockManager.flockTargetPosition - transform.position; 81 | transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.LookRotation (dir), currentRotationSpeed * Time.deltaTime); 82 | } 83 | else 84 | { 85 | //Trying to avoid some fps spikes, we will apply the rules for the flock randomly 86 | //It is not needed to be called once per frame. 87 | float randomFlockLogic = Random.Range (0, 30); 88 | if (randomFlockLogic == 5) 89 | ApplyFlockingRules (); 90 | } 91 | 92 | //The bird is always moving forward 93 | this.transform.Translate (this.transform.forward * currentSpeed * Time.deltaTime, Space.World); 94 | 95 | } 96 | 97 | //If we let the bird plan if it goes down we won't rotate the wings anymore. 98 | if (enableGliding) 99 | { 100 | //If the dot product of the bird's forward and the Up vector is less than -0.1f then is planning is true, which means that we won't have to rotate the wings 101 | isGliding = Vector3.Dot (this.transform.forward, Vector3.up) < -0.1f; 102 | 103 | //Rotate wings 104 | if (isGliding == false) 105 | RotateWings (); 106 | } else 107 | { 108 | RotateWings (); 109 | } 110 | 111 | } 112 | 113 | /// 114 | /// Rotate the wings 115 | /// 116 | private void RotateWings () 117 | { 118 | //Get the current angle for one of the wing. 119 | //We only need one of them 120 | float currentAngle = GetCurrentAngle (this.rightWing.transform.localEulerAngles.z); 121 | 122 | if (rotateWingsBack == false) 123 | { 124 | if (currentAngle > wingAngle) 125 | { 126 | currentWingsRotationSpeed *= -1; 127 | rotateWingsBack = true; 128 | } 129 | } 130 | else 131 | { 132 | //If we are rotating back to 0, check if we hit the 0 value. 133 | //If it is 0 then go rotate to wing angle 134 | if (currentAngle < 0f) 135 | { 136 | rotateWingsBack = false; 137 | currentWingsRotationSpeed *= -1; 138 | } 139 | } 140 | 141 | //Rotate the wings. 142 | //Don't forget that we are rotating the left wings to -wing angle 143 | this.rightWing.Rotate (0, 0, currentWingsRotationSpeed * Time.deltaTime); 144 | this.leftWing.Rotate (0, 0, -currentWingsRotationSpeed * Time.deltaTime); 145 | } 146 | 147 | /// 148 | /// Get the current local euler angle, with - sign 149 | /// 150 | /// 151 | /// 152 | float GetCurrentAngle (float localEulerAngle) 153 | { 154 | return (localEulerAngle > 180 ? localEulerAngle - 360 : localEulerAngle); 155 | } 156 | 157 | /// 158 | /// Change the speed 159 | /// 160 | private void ChangeCurrentSpeed () 161 | { 162 | currentSpeed = Random.Range (minSpeed, maxSpeed); 163 | } 164 | 165 | /// 166 | /// Apply flocking rules. 167 | /// 168 | void ApplyFlockingRules () 169 | { 170 | //We are calculating the center of a group and make the current bird move to the center of the group 171 | //The bird might be always face the avarage heading of the group 172 | //The birds must avoid the closer neighbours 173 | 174 | //To get the center we will add all positions of the birds and divede it with the count of birds 175 | Vector3 groupCenter = Vector3.zero; 176 | //The avoidance. 177 | Vector3 avoidanceVector = Vector3.zero; 178 | //Distance between 2 birds 179 | float distance; 180 | //We will need the list of all the birds existent, that we have in the FlockManager 181 | for (int i = 0; i < flockManager.spawnedBirds.Count; i++) 182 | { 183 | Bird currentBird = flockManager.spawnedBirds[i]; 184 | //Don't do that for the current bird 185 | if (currentBird != this) 186 | { 187 | //Get the distance between the 2 birds 188 | distance = Vector3.Distance (this.transform.position, currentBird.transform.position); 189 | 190 | //If we are closer than 1 meter than add the diference between this position and the current bird position 191 | if (distance < 1f) 192 | { 193 | avoidanceVector += (this.transform.position - currentBird.transform.position); 194 | } 195 | //Add the bird to the group 196 | groupCenter += currentBird.transform.position; 197 | } 198 | } 199 | 200 | //Divie the group center 201 | groupCenter /= (flockManager.spawnedBirds.Count - 1); 202 | //Set the direction based on target position, the group center and the avoidance 203 | Vector3 direction = (groupCenter + flockManager.flockTargetPosition + avoidanceVector) - this.transform.position; 204 | //Rotate the bird 205 | if (direction != Vector3.zero) 206 | transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.LookRotation (direction), currentRotationSpeed * Time.deltaTime); 207 | } 208 | } 209 | } 210 | --------------------------------------------------------------------------------