├── Assets ├── Sprites │ ├── AsteroidsArcade.png │ └── AsteroidsArcade.png.meta ├── Sources │ ├── View │ │ ├── ShipDebugUIView.cs │ │ ├── ShipDebugUIView.cs.meta │ │ ├── BulletsViewFactory.cs.meta │ │ ├── EndGameWindowView.cs.meta │ │ ├── EnemiesViewFactory.cs.meta │ │ ├── TransformableView.cs.meta │ │ ├── PhysicsEventsBroadcaster.cs.meta │ │ ├── TransformableViewFactory.cs.meta │ │ ├── EndGameWindowView.cs │ │ ├── PhysicsEventsBroadcaster.cs │ │ ├── BulletsViewFactory.cs │ │ ├── TransformableView.cs │ │ ├── EnemiesViewFactory.cs │ │ └── TransformableViewFactory.cs │ ├── View.meta │ ├── Input.meta │ ├── Model.meta │ ├── CompositeRoot.meta │ ├── Model │ │ ├── Enemies.meta │ │ ├── Weapon.meta │ │ ├── ModelAssembly.asmdef.meta │ │ ├── Simulations.meta │ │ ├── Config.cs │ │ ├── Ship.cs.meta │ │ ├── Config.cs.meta │ │ ├── Timers.cs.meta │ │ ├── Enemies │ │ │ ├── Enemy.cs.meta │ │ │ ├── Nlo.cs.meta │ │ │ ├── Asteroid.cs.meta │ │ │ ├── Enemy.cs │ │ │ ├── Nlo.cs │ │ │ └── Asteroid.cs │ │ ├── InertMovement.cs.meta │ │ ├── PhysicsRouter.cs.meta │ │ ├── ShipMovement.cs.meta │ │ ├── Transformable.cs.meta │ │ ├── Weapon │ │ │ ├── Bullet.cs.meta │ │ │ ├── LaserGun.cs.meta │ │ │ ├── DefaultGun.cs.meta │ │ │ ├── LaserGunRollback.cs.meta │ │ │ ├── DefaultGun.cs │ │ │ ├── Bullet.cs │ │ │ ├── LaserGunRollback.cs │ │ │ └── LaserGun.cs │ │ ├── CollisionsRecords.cs.meta │ │ ├── Simulations │ │ │ ├── Simulation.cs.meta │ │ │ ├── Trajectory.cs.meta │ │ │ ├── BulletsSimulation.cs.meta │ │ │ ├── EnemiesSimulation.cs.meta │ │ │ ├── EnemiesSpawner.cs.meta │ │ │ ├── EnemiesSimulation.cs │ │ │ ├── Trajectory.cs │ │ │ ├── BulletsSimulation.cs │ │ │ ├── Simulation.cs │ │ │ └── EnemiesSpawner.cs │ │ ├── ModelAssembly.asmdef │ │ ├── Ship.cs │ │ ├── Transformable.cs │ │ ├── InertMovement.cs │ │ ├── ShipMovement.cs │ │ ├── Timers.cs │ │ ├── CollisionsRecords.cs │ │ └── PhysicsRouter.cs │ ├── CompositeRoot │ │ ├── CompositeRoot.cs │ │ ├── CompositeRoot.cs.meta │ │ ├── CompositionOrder.cs.meta │ │ ├── EnemiesCompositeRoot.cs.meta │ │ ├── ShipCompositeRoot.cs.meta │ │ ├── PhysicsRoutingCompositeRoot.cs.meta │ │ ├── CompositionOrder.cs │ │ ├── EnemiesCompositeRoot.cs │ │ ├── PhysicsRoutingCompositeRoot.cs │ │ └── ShipCompositeRoot.cs │ └── Input │ │ ├── ShipInput.cs.meta │ │ ├── ShipInputRouter.cs.meta │ │ ├── ShipInput.inputactions.meta │ │ ├── ShipInputRouter.cs │ │ ├── ShipInput.inputactions │ │ └── ShipInput.cs ├── Prefabs │ ├── Nlo.prefab.meta │ ├── Asteroid.prefab.meta │ ├── Bullet.prefab.meta │ ├── Laser.prefab.meta │ ├── PartOfAsteroid.prefab.meta │ ├── Nlo.prefab │ ├── Asteroid.prefab │ ├── PartOfAsteroid.prefab │ ├── Bullet.prefab │ └── Laser.prefab ├── Prefabs.meta ├── Scenes.meta ├── Scenes │ └── SampleScene.unity.meta ├── Sources.meta ├── Sprites.meta ├── InputSystem.inputsettings.asset.meta └── InputSystem.inputsettings.asset ├── ProjectSettings ├── ProjectVersion.txt ├── ClusterInputManager.asset ├── PresetManager.asset ├── XRSettings.asset ├── VersionControlSettings.asset ├── TimeManager.asset ├── EditorBuildSettings.asset ├── VFXManager.asset ├── AudioManager.asset ├── TagManager.asset ├── UnityConnectSettings.asset ├── EditorSettings.asset ├── PackageManagerSettings.asset ├── DynamicsManager.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── QualitySettings.asset └── ProjectSettings.asset ├── .vsconfig ├── README.md ├── .gitignore ├── Packages ├── manifest.json └── packages-lock.json └── .gitattributes /Assets/Sprites/AsteroidsArcade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HolyMonkey/Asteroids/HEAD/Assets/Sprites/AsteroidsArcade.png -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.1.18f1 2 | m_EditorVersionWithRevision: 2021.1.18f1 (25bdc3efbc2d) 3 | -------------------------------------------------------------------------------- /.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Assets/Sources/View/ShipDebugUIView.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HolyMonkey/Asteroids/HEAD/Assets/Sources/View/ShipDebugUIView.cs -------------------------------------------------------------------------------- /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/Prefabs/Nlo.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 227e6133de9075a44aa0ad05e2399431 3 | PrefabImporter: 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/Prefabs/Asteroid.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b512be35dd70a740b70ad3f11129f6b 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Prefabs/Bullet.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ac0a761c39837c438fc2f5cbde37379 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Prefabs/Laser.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5945db22c3379bd48891ca1f8fa788e5 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b9c3f6112aaca148bea05de8722830f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/PartOfAsteroid.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9673b8bf2b901049947fef6ed94e495 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04c3c3a447f19c64781f5fde2c40c478 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Sources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2eae5c8912aca1d46bf12872994905a0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f1e9c7b5f137154d849f20c777736be 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Sources/View.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 06da3f139f0484e4c9caf5a7efc5eb51 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Sources/Input.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f423d49594a5ce47a91e5b39d0059b7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Sources/Model.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc26fd630aa4ade46a92acd4c7170730 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Sources/CompositeRoot.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30ed35a8d1105394b82992a85b5de781 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Enemies.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8234018bb74218f4a8670357fc4cb204 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Weapon.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 626a16f38d7c6354e9a7434ff08bfb3d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /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/Sources/Model/ModelAssembly.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fed44a9ddb28ef41a0bdf395b8e9e1b 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Simulations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d41c7ece8eeb5234c9dcdb70b22eb2f8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Sources/CompositeRoot/CompositeRoot.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CompositeRoot 4 | { 5 | public abstract class CompositeRoot : MonoBehaviour 6 | { 7 | public abstract void Compose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Assets/InputSystem.inputsettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9fa810507800014ca8029b31ca258bc 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 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/Sources/Model/Config.cs: -------------------------------------------------------------------------------- 1 | namespace Asteroids.Model 2 | { 3 | public static class Config 4 | { 5 | public const float NloSpeed = 0.075f; 6 | public const float AsteroidSpeed = 0.075f; 7 | public const float LaserCooldown = 3f; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Ship.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec4e1c404a5e5d04ca0f55bbe853f0e4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Input/ShipInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11f973187da7629429aae666df1d47de 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Config.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 413f42adeccef3d42898912405cac155 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Timers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b6fafd380282b849b8bb383d0f631a1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Input/ShipInputRouter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47062da65108c2a4b8ab9ee73dbbb3a6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Enemies/Enemy.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6123154b6fab3b243a3118853d6fa692 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Enemies/Nlo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 830063c2597405c449b7b5fc5752b073 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/InertMovement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: befe08f6b296fc449bd4a30135df59a7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/PhysicsRouter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 847648fc52ba98e468d740df45f93d13 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/ShipMovement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 319c5e4721487a84fbd1034280907b81 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Transformable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ecdaacc41d218da40973338e1ef76362 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Weapon/Bullet.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3bdfddc3bbb0c444b5d25572dd3106a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Weapon/LaserGun.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6acafe4b1ee9c3b45a3404ae41817841 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/View/ShipDebugUIView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23859c3c2e75bee49a1c80e317f6b9eb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /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 | com.unity.input.settings: {fileID: 11400000, guid: f9fa810507800014ca8029b31ca258bc, type: 2} 10 | -------------------------------------------------------------------------------- /Assets/Sources/Model/CollisionsRecords.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05db182cc4258c44cac230d1888e0bc4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Enemies/Asteroid.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 665ca8801de9b9a49be3b28b4e5c6866 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Enemies/Enemy.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Asteroids.Model 4 | { 5 | public abstract class Enemy : Transformable 6 | { 7 | public Enemy(Vector2 position, float rotation) : base(position, rotation) { } 8 | 9 | public abstract void Update(float deltaTime); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Weapon/DefaultGun.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca656c98f63e87b459ce9856c58cd0a9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/View/BulletsViewFactory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08d0a4a1908fb674fbd2007a67a2bb19 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/View/EndGameWindowView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 698b3b38c0ee5a34fb90f857b92b123f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/View/EnemiesViewFactory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81eebecd6a2b1f24db6495e8352b0eb1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/View/TransformableView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64bef8e5aef082e4fb2813f02d1368c5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/CompositeRoot/CompositeRoot.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 408a48fe13f5f794fb1c2562925f1581 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/CompositeRoot/CompositionOrder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d8dbcba09d97854d9f8123f150f2dbb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Simulations/Simulation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2dc6b33555d4504ebcc96cd64f8fd93 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Simulations/Trajectory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 000b27e7d2803de439923819a642db8b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Weapon/LaserGunRollback.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45f67000bdde2c74daeef39c61ad4fc2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/View/PhysicsEventsBroadcaster.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f191ce631aab81249ad8b0564e585177 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/View/TransformableViewFactory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e613ebf5eb9a6d7498fcd9c58799580a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/CompositeRoot/EnemiesCompositeRoot.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8028b2bc9fd9ca49a7b5985d8cc2aad 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/CompositeRoot/ShipCompositeRoot.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28355239b39176e409bd2e8e93ceb55f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: -101 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Simulations/BulletsSimulation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09ae4a974d594334b867fda4167176e6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Simulations/EnemiesSimulation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9aa30c20cd950f84cb6be2ba7cf9d794 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Simulations/EnemiesSpawner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 580215cfe7493d840812ab2b24ae3986 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sources/CompositeRoot/PhysicsRoutingCompositeRoot.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 824eb8bdcb2e31d4f9423972b9a665fe 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/Sources/Model/ModelAssembly.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ModelAssembly", 3 | "rootNamespace": "Asteroids.Model", 4 | "references": [], 5 | "includePlatforms": [], 6 | "excludePlatforms": [], 7 | "allowUnsafeCode": false, 8 | "overrideReferences": false, 9 | "precompiledReferences": [], 10 | "autoReferenced": true, 11 | "defineConstraints": [], 12 | "versionDefines": [], 13 | "noEngineReferences": false 14 | } -------------------------------------------------------------------------------- /Assets/Sources/Input/ShipInput.inputactions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92045e14998092743b2eff1bbb6bf8e9 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} 11 | generateWrapperCode: 1 12 | wrapperCodePath: 13 | wrapperClassName: 14 | wrapperCodeNamespace: Asteroids.Input 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/Sources/CompositeRoot/CompositionOrder.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | namespace CompositeRoot 5 | { 6 | class CompositionOrder : MonoBehaviour 7 | { 8 | [SerializeField] private List _order; 9 | 10 | private void Awake() 11 | { 12 | foreach (var compositionRoot in _order) 13 | { 14 | compositionRoot.Compose(); 15 | compositionRoot.enabled = true; 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Ship.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Asteroids.Model 5 | { 6 | public class Ship : Transformable 7 | { 8 | public Ship(Vector2 position, float rotation) : base(position, rotation) { } 9 | 10 | public void MoveLooped(Vector2 delta) 11 | { 12 | var nextPosition = Position + delta; 13 | 14 | nextPosition.x = Mathf.Repeat(nextPosition.x, 1); 15 | nextPosition.y = Mathf.Repeat(nextPosition.y, 1); 16 | 17 | Position = nextPosition; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Sources/View/EndGameWindowView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | class EndGameWindowView : MonoBehaviour 6 | { 7 | [SerializeField] private Button _restartButton; 8 | [SerializeField] private Text _scoreLabel; 9 | 10 | public void Show(int score, Action onReloadClick) 11 | { 12 | _scoreLabel.text = $"You Score - {score}"; 13 | 14 | _restartButton.onClick.RemoveAllListeners(); 15 | _restartButton.onClick.AddListener(() => onReloadClick()); 16 | 17 | gameObject.SetActive(true); 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 | - 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/Sources/Model/Transformable.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Asteroids.Model 4 | { 5 | public abstract class Transformable 6 | { 7 | public virtual Vector2 Position { get; protected set; } 8 | public float Rotation { get; private set; } 9 | 10 | public Transformable(Vector2 position, float rotation) 11 | { 12 | Position = position; 13 | Rotation = rotation; 14 | } 15 | 16 | public void Rotate(float delta) 17 | { 18 | Rotation = Mathf.Repeat(Rotation + delta, 360); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Weapon/DefaultGun.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Asteroids.Model 5 | { 6 | public class DefaultGun 7 | { 8 | public event Action Shot; 9 | 10 | public virtual bool CanShoot() => true; 11 | 12 | public void Shoot() 13 | { 14 | if (CanShoot() == false) 15 | throw new InvalidOperationException(); 16 | 17 | Bullet bullet = GetBullet(); 18 | Shot?.Invoke(bullet); 19 | } 20 | 21 | protected virtual Bullet GetBullet() => new DefaultBullet(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Sources/View/PhysicsEventsBroadcaster.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Asteroids.Model; 3 | 4 | public class PhysicsEventsBroadcaster : MonoBehaviour 5 | { 6 | private PhysicsRouter _router; 7 | private object _model; 8 | 9 | public void Init(PhysicsRouter router, object model) 10 | { 11 | _router = router; 12 | _model = model; 13 | } 14 | 15 | private void OnCollisionEnter2D(Collision2D collision) 16 | { 17 | if(collision.collider.TryGetComponent(out PhysicsEventsBroadcaster broadcaster)) 18 | _router.TryAddCollision(_model, broadcaster._model); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Weapon/Bullet.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Asteroids.Model 5 | { 6 | public abstract class Bullet 7 | { 8 | public readonly float Lifetime; 9 | public readonly float Speed; 10 | 11 | protected Bullet(float lifetime, float speed) 12 | { 13 | Lifetime = lifetime; 14 | Speed = speed; 15 | } 16 | } 17 | 18 | public class LaserGunBullet : Bullet 19 | { 20 | public LaserGunBullet() : base(0.5F, 0F) { } 21 | } 22 | 23 | public class DefaultBullet : Bullet 24 | { 25 | public DefaultBullet() : base(10F, 0.6F) { } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Simulations/EnemiesSimulation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Asteroids.Model 8 | { 9 | public class EnemiesSimulation : Simulation 10 | { 11 | public void Simulate(Enemy enemy) 12 | { 13 | PlacedEntity placedEntity = new PlacedEntity(enemy, enemy); 14 | 15 | Simulate(placedEntity); 16 | } 17 | 18 | public override void Update(float deltaTime) 19 | { 20 | foreach (var entity in Entities) 21 | entity.Entity.Update(deltaTime); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/Sources/View/BulletsViewFactory.cs: -------------------------------------------------------------------------------- 1 | using Asteroids.Model; 2 | using System; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | public class BulletsViewFactory : TransformableViewFactory 7 | { 8 | [SerializeField] private TransformableView _defaultBulletTemplate; 9 | [SerializeField] private TransformableView _laserBulletTemplate; 10 | 11 | protected override TransformableView GetTemplate(Bullet bullet) 12 | { 13 | if (bullet is DefaultBullet) 14 | return _defaultBulletTemplate; 15 | else if (bullet is LaserGunBullet) 16 | return _laserBulletTemplate; 17 | 18 | throw new InvalidOperationException(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Sources/View/TransformableView.cs: -------------------------------------------------------------------------------- 1 | using Asteroids.Model; 2 | using UnityEngine; 3 | 4 | public class TransformableView : MonoBehaviour 5 | { 6 | private Camera _camera; 7 | private Transformable _model; 8 | 9 | public void Init(Transformable model, Camera camera) 10 | { 11 | _model = model; 12 | _camera = camera; 13 | } 14 | 15 | public void LateUpdate() 16 | { 17 | transform.position = _camera.ViewportToWorldPoint(GetViewportPosition()); 18 | transform.rotation = Quaternion.Euler(0, 0, _model.Rotation); 19 | } 20 | 21 | private Vector3 GetViewportPosition() 22 | { 23 | return new Vector3(_model.Position.x, _model.Position.y, 1); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Клон игры Asteroids 2 | 3 | Проект сделан в рамках курса Напильник от школы ЯЮниор. Он является решением тестового задания одной из студий программирования и показывает как можно писать логику игры в отдельной модели без наследования от MonoBehaviour. 4 | 5 | Проект не является идеальным и в нём присутствует ряд косяков и убийц объектного дизайна, исправить которые предлагается ученикам на курсе, чтобы познакомиться с кодом плотней. 6 | 7 | Здесь ванильная версия Unity без применения Zenject и etc. 8 | 9 | Подробней о курсе - https://ijunior.ru/napilnik?utm_source=github&utm_content=asteroids 10 | 11 | 12 | P.S: 13 | Задача - https://docs.google.com/document/d/1_2FPU2l_L7s5MPc9GJwN6QKcRNTRWgqKJasJ07PMXbY/edit?usp=sharing 14 | -------------------------------------------------------------------------------- /Assets/Sources/View/EnemiesViewFactory.cs: -------------------------------------------------------------------------------- 1 | using Asteroids.Model; 2 | using System; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | public class EnemiesViewFactory : TransformableViewFactory 7 | { 8 | [SerializeField] private TransformableView _asteroid; 9 | [SerializeField] private TransformableView _partOfAsteroid; 10 | [SerializeField] private TransformableView _nlo; 11 | 12 | protected override TransformableView GetTemplate(Enemy enemy) 13 | { 14 | if (enemy is PartOfAsteroid) 15 | return _partOfAsteroid; 16 | else if (enemy is Asteroid) 17 | return _asteroid; 18 | else if (enemy is Nlo) 19 | return _nlo; 20 | 21 | throw new InvalidOperationException(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Sources/Model/InertMovement.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Asteroids.Model 4 | { 5 | public class InertMovement 6 | { 7 | private readonly float _unitsPerSecond = 0.001f; 8 | private readonly float _maxSpeed = 0.0015f; 9 | private readonly float _secondsToStop = 1f; 10 | 11 | public Vector2 Acceleration { get; private set; } 12 | 13 | public void Accelerate(Vector2 forward, float deltaTime) 14 | { 15 | Acceleration += forward * (_unitsPerSecond * deltaTime); 16 | Acceleration = Vector2.ClampMagnitude(Acceleration, _maxSpeed); 17 | } 18 | 19 | public void Slowdown(float deltaTime) 20 | { 21 | Acceleration -= Acceleration * (deltaTime / _secondsToStop); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/InputSystem.inputsettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 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: 11500000, guid: c46f07b5ed07e4e92aa78254188d3d10, type: 3} 13 | m_Name: InputSystem.inputsettings 14 | m_EditorClassIdentifier: 15 | m_SupportedDevices: [] 16 | m_UpdateMode: 1 17 | m_CompensateForScreenOrientation: 1 18 | m_FilterNoiseOnCurrent: 0 19 | m_DefaultDeadzoneMin: 0.125 20 | m_DefaultDeadzoneMax: 0.925 21 | m_DefaultButtonPressPoint: 0.5 22 | m_DefaultTapTime: 0.2 23 | m_DefaultSlowTapTime: 0.5 24 | m_DefaultHoldTime: 0.4 25 | m_TapRadius: 5 26 | m_MultiTapDelayTime: 0.75 27 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Enemies/Nlo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Asteroids.Model 5 | { 6 | public class Nlo : Enemy 7 | { 8 | private readonly float _speed; 9 | private readonly Transformable _target; 10 | 11 | public Nlo(Transformable target, Vector2 position, float speed) : base(position, 0) 12 | { 13 | _target = target; 14 | _speed = speed; 15 | } 16 | 17 | public override void Update(float deltaTime) 18 | { 19 | Position = Vector2.MoveTowards(Position, _target.Position, _speed * deltaTime); 20 | LookAt(_target.Position); 21 | } 22 | 23 | private void LookAt(Vector2 point) 24 | { 25 | Rotate(Vector2.SignedAngle(Quaternion.Euler(0, 0, Rotation) * Vector3.up, (Position - point))); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Weapon/LaserGunRollback.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Asteroids.Model 4 | { 5 | public class LaserGunRollback 6 | { 7 | public readonly float Cooldown; 8 | 9 | private readonly LaserGun _laser; 10 | 11 | public float AccumulatedTime { get; private set; } 12 | 13 | public LaserGunRollback(LaserGun laser, float cooldown) 14 | { 15 | _laser = laser; 16 | Cooldown = cooldown; 17 | } 18 | 19 | public void Tick(float deltaTime) 20 | { 21 | if (_laser.Bullets == _laser.MaxBullets) 22 | return; 23 | 24 | AccumulatedTime += deltaTime; 25 | 26 | if (AccumulatedTime >= Cooldown) 27 | { 28 | _laser.TryAddShot(); 29 | AccumulatedTime = 0; 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Assets/Sources/Model/ShipMovement.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Asteroids.Model 5 | { 6 | public class ShipMovement 7 | { 8 | private readonly Ship _ship; 9 | private readonly float _degreesPerSecond = 180; 10 | 11 | public Vector2 Forward => Quaternion.Euler(0, 0, _ship.Rotation) * Vector3.up; 12 | 13 | public ShipMovement(Ship ship) 14 | { 15 | _ship = ship; 16 | } 17 | 18 | public void Move(Vector2 delta) 19 | { 20 | _ship.MoveLooped(delta); 21 | } 22 | 23 | public void Rotate(float direction, float deltaTime) 24 | { 25 | if (direction == 0) 26 | throw new InvalidOperationException(nameof(direction)); 27 | 28 | direction = direction > 0 ? 1 : -1; 29 | 30 | _ship.Rotate(direction * deltaTime * _degreesPerSecond); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Simulations/Trajectory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Asteroids.Model 5 | { 6 | public class Trajectory : Transformable 7 | { 8 | public readonly float Speed; 9 | public readonly Vector2 StartPosition; 10 | public readonly Vector2 Direction; 11 | 12 | private readonly Func _currentTimeProvider; 13 | 14 | public override Vector2 Position => StartPosition + (Direction * Speed * _currentTimeProvider.Invoke(this)); 15 | 16 | public Trajectory(float speed, Vector2 startPosition, Vector2 direction, Func currentTimeProvider) 17 | : base(startPosition, Vector2.SignedAngle(Vector3.up, direction)) 18 | { 19 | StartPosition = startPosition; 20 | Direction = direction; 21 | Speed = speed; 22 | _currentTimeProvider = currentTimeProvider; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Enemies/Asteroid.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Asteroids.Model 4 | { 5 | public class Asteroid : Enemy 6 | { 7 | private readonly Vector2 _direction; 8 | private readonly float _speed; 9 | 10 | public Asteroid(Vector2 position, Vector2 direction, float speed) : base(position, 0) 11 | { 12 | _direction = direction; 13 | _speed = speed; 14 | } 15 | 16 | public override void Update(float deltaTime) 17 | { 18 | Position = Position + _direction * _speed * deltaTime; 19 | } 20 | 21 | public PartOfAsteroid CreatePart() 22 | { 23 | return new PartOfAsteroid(Position, Random.insideUnitCircle.normalized, _speed / 2); 24 | } 25 | } 26 | 27 | public class PartOfAsteroid : Asteroid 28 | { 29 | public PartOfAsteroid(Vector2 position, Vector2 direction, float speed) : base(position, direction, speed) { } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /Assets/Sources/Model/Simulations/BulletsSimulation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | 6 | namespace Asteroids.Model 7 | { 8 | public class BulletsSimulation : Simulation 9 | { 10 | private readonly Timers.PlacedEntity> _timers = new Timers.PlacedEntity>(); 11 | 12 | public void Simulate(Bullet bullet, Vector2 startPosition, Vector2 direction) 13 | { 14 | PlacedEntity placedEntity = null; 15 | var trajectory = new Trajectory(bullet.Speed, startPosition, direction, (_) => _timers.GetAccumulatedTime(placedEntity)); 16 | placedEntity = new PlacedEntity(bullet, trajectory); 17 | 18 | _timers.Start(placedEntity, bullet.Lifetime, Stop); 19 | 20 | Simulate(placedEntity); 21 | } 22 | 23 | public override void Update(float deltaTime) 24 | { 25 | _timers.Tick(deltaTime); 26 | } 27 | 28 | protected override void OnStoped(PlacedEntity placedEntity) 29 | { 30 | _timers.StopAll(placedEntity); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /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_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_UserSelectedRegistryName: 29 | m_UserAddingNewScopedRegistry: 0 30 | m_RegistryInfoDraft: 31 | m_ErrorMessage: 32 | m_Original: 33 | m_Id: 34 | m_Name: 35 | m_Url: 36 | m_Scopes: [] 37 | m_IsDefault: 0 38 | m_Capabilities: 0 39 | m_Modified: 0 40 | m_Name: 41 | m_Url: 42 | m_Scopes: 43 | - 44 | m_SelectedScopeIndex: 0 45 | m_LoadAssets: 0 46 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Weapon/LaserGun.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Asteroids.Model 5 | { 6 | public class LaserGun : DefaultGun 7 | { 8 | private int _bulletsPerShot; 9 | 10 | public int Bullets { get; private set; } 11 | public int MaxBullets { get; private set; } 12 | 13 | public event Action ShotAdd; 14 | 15 | public LaserGun(int bullets, int bulletsPerShot = 1) 16 | { 17 | if (bulletsPerShot < 0) 18 | throw new ArgumentOutOfRangeException(nameof(bulletsPerShot)); 19 | 20 | if (bullets <= 0) 21 | throw new ArgumentOutOfRangeException(nameof(bullets)); 22 | 23 | Bullets = bullets; 24 | MaxBullets = bullets; 25 | _bulletsPerShot = bulletsPerShot; 26 | } 27 | 28 | public override bool CanShoot() => Bullets >= _bulletsPerShot; 29 | 30 | public void TryAddShot() 31 | { 32 | if (Bullets + _bulletsPerShot > MaxBullets) 33 | return; 34 | 35 | Bullets += _bulletsPerShot; 36 | ShotAdd?.Invoke(); 37 | } 38 | 39 | protected override Bullet GetBullet() 40 | { 41 | Bullets -= _bulletsPerShot; 42 | return new LaserGunBullet(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/Sources/View/TransformableViewFactory.cs: -------------------------------------------------------------------------------- 1 | using Asteroids.Model; 2 | using CompositeRoot; 3 | using System; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | 7 | public abstract class TransformableViewFactory : MonoBehaviour 8 | { 9 | [SerializeField] private Camera _camera; 10 | [SerializeField] private PhysicsRoutingCompositeRoot _router; 11 | 12 | private Dictionary.PlacedEntity, TransformableView> _views = new Dictionary.PlacedEntity, TransformableView>(); 13 | 14 | public void Create(Simulation.PlacedEntity placedEntity) 15 | { 16 | TransformableView view = Instantiate(GetTemplate(placedEntity.Entity), placedEntity.Transform.Position, Quaternion.identity); 17 | 18 | if(view.gameObject.TryGetComponent(out PhysicsEventsBroadcaster broadcaster)) 19 | { 20 | broadcaster.Init(_router.Model, placedEntity.Entity); 21 | } 22 | 23 | view.Init(placedEntity.Transform, _camera); 24 | 25 | _views.Add(placedEntity, view); 26 | } 27 | 28 | public void Destroy(Simulation.PlacedEntity placedEntity) 29 | { 30 | TransformableView view = _views[placedEntity]; 31 | 32 | _views.Remove(placedEntity); 33 | 34 | Destroy(view.gameObject); 35 | } 36 | 37 | protected abstract TransformableView GetTemplate(T entity); 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Sources/CompositeRoot/EnemiesCompositeRoot.cs: -------------------------------------------------------------------------------- 1 | using Asteroids.Input; 2 | using Asteroids.Model; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.InputSystem; 6 | 7 | namespace CompositeRoot 8 | { 9 | public class EnemiesCompositeRoot : CompositeRoot 10 | { 11 | [SerializeField] private EnemiesViewFactory _viewFactory; 12 | [SerializeField] private ShipCompositeRoot _ship; 13 | 14 | private EnemiesSimulation _simulation; 15 | private EnemiesSpawner _spawner; 16 | 17 | public EnemiesSimulation Simulation => _simulation; 18 | 19 | public override void Compose() 20 | { 21 | _simulation = new EnemiesSimulation(); 22 | _spawner = new EnemiesSpawner(_simulation, _ship.Model); 23 | _spawner.FillTestQueue(); 24 | } 25 | 26 | private void OnEnable() 27 | { 28 | _simulation.Start += _viewFactory.Create; 29 | _simulation.End += _viewFactory.Destroy; 30 | } 31 | 32 | private void OnDisable() 33 | { 34 | _simulation.Start -= _viewFactory.Create; 35 | _simulation.End -= _viewFactory.Destroy; 36 | } 37 | 38 | private void Update() 39 | { 40 | _simulation.Update(Time.deltaTime); 41 | _spawner.Update(Time.deltaTime); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /.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 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Asset meta data should only be ignored when the corresponding asset is also ignored 18 | !/[Aa]ssets/**/*.meta 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.unityproj 37 | *.sln 38 | *.suo 39 | *.tmp 40 | *.user 41 | *.userprefs 42 | *.pidb 43 | *.booproj 44 | *.svd 45 | *.pdb 46 | *.mdb 47 | *.opendb 48 | *.VC.db 49 | 50 | # Unity3D generated meta files 51 | *.pidb.meta 52 | *.pdb.meta 53 | *.mdb.meta 54 | 55 | # Unity3D generated file on crash reports 56 | sysinfo.txt 57 | 58 | # Builds 59 | *.apk 60 | *.aab 61 | *.unitypackage 62 | 63 | # Crashlytics generated file 64 | crashlytics-build.properties 65 | 66 | # Packed Addressables 67 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 68 | 69 | # Temporary auto-generated Android Assets 70 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 71 | /[Aa]ssets/[Ss]treamingAssets/aa/* -------------------------------------------------------------------------------- /Assets/Sources/Model/Simulations/Simulation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Collections.Generic; 4 | 5 | namespace Asteroids.Model 6 | { 7 | public abstract class Simulation 8 | { 9 | private List _entities = new List(); 10 | 11 | public IEnumerable Entities => _entities; 12 | 13 | public event Action Start; 14 | public event Action End; 15 | 16 | public abstract void Update(float deltaTime); 17 | 18 | protected void Simulate(PlacedEntity placedEntity) 19 | { 20 | _entities.Add(placedEntity); 21 | Start?.Invoke(placedEntity); 22 | } 23 | 24 | protected void Stop(PlacedEntity placedEntity) 25 | { 26 | _entities.Remove(placedEntity); 27 | End?.Invoke(placedEntity); 28 | OnStoped(placedEntity); 29 | } 30 | 31 | protected virtual void OnStoped(PlacedEntity placedEntity) { } 32 | 33 | public void StopAll(T model) 34 | { 35 | List candidats = _entities.Where(entity => entity.Entity.Equals(model)).ToList(); 36 | candidats.ForEach(Stop); 37 | } 38 | 39 | public class PlacedEntity 40 | { 41 | public readonly T Entity; 42 | public readonly Transformable Transform; 43 | 44 | public PlacedEntity(T entity, Transformable transform) 45 | { 46 | Entity = entity; 47 | Transform = transform; 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Timers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Asteroids.Model 6 | { 7 | class Timers 8 | { 9 | private List _timers = new List(); 10 | 11 | public void Start(T context, float time, Action onEnd) 12 | { 13 | _timers.Add(new Timer(context, time, onEnd)); 14 | } 15 | 16 | public void StopAll (T context) 17 | { 18 | _timers.RemoveAll(timer => timer.Context.Equals(context)); 19 | } 20 | 21 | public void Tick(float deltaTime) 22 | { 23 | foreach (var timer in _timers.ToList()) 24 | { 25 | timer.AccumulatedTime += deltaTime; 26 | 27 | if(timer.IsEnd) 28 | { 29 | _timers.Remove(timer); 30 | timer.OnEnd.Invoke(timer.Context); 31 | } 32 | } 33 | } 34 | 35 | public float GetAccumulatedTime(T context) 36 | { 37 | return _timers.First(timer => timer.Context.Equals(context)).AccumulatedTime; 38 | } 39 | 40 | private class Timer 41 | { 42 | public float AccumulatedTime; 43 | public readonly float Time; 44 | public readonly T Context; 45 | public readonly Action OnEnd; 46 | 47 | public bool IsEnd => Time <= AccumulatedTime; 48 | 49 | public Timer(T context, float time, Action onEnd) 50 | { 51 | Time = time; 52 | Context = context; 53 | OnEnd = onEnd; 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /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/Sources/Model/CollisionsRecords.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using static Asteroids.Model.PhysicsRouter; 4 | 5 | namespace Asteroids.Model 6 | { 7 | public class CollisionsRecords 8 | { 9 | private readonly BulletsSimulation _bullets; 10 | private readonly EnemiesSimulation _enemies; 11 | 12 | public event Action GameEnd; 13 | 14 | public CollisionsRecords(BulletsSimulation bullets, EnemiesSimulation enemies) 15 | { 16 | _bullets = bullets; 17 | _enemies = enemies; 18 | } 19 | 20 | public IEnumerable Values() 21 | { 22 | yield return IfCollided((Bullet bullet, Enemy enemy) => 23 | { 24 | _enemies.StopAll(enemy); 25 | }); 26 | 27 | yield return IfCollided((DefaultBullet bullet, Enemy enemy) => 28 | { 29 | _bullets.StopAll(bullet); 30 | }); 31 | 32 | yield return IfCollided((Bullet bullet, Asteroid asteroid) => 33 | { 34 | if (asteroid is PartOfAsteroid) 35 | return; 36 | 37 | _enemies.Simulate(asteroid.CreatePart()); 38 | _enemies.Simulate(asteroid.CreatePart()); 39 | _enemies.Simulate(asteroid.CreatePart()); 40 | _enemies.Simulate(asteroid.CreatePart()); 41 | }); 42 | 43 | yield return IfCollided((Ship ship, Enemy enemy) => 44 | { 45 | GameEnd?.Invoke(); 46 | }); 47 | } 48 | 49 | private Record IfCollided(Action action) 50 | { 51 | return new Record(action); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/Sources/CompositeRoot/PhysicsRoutingCompositeRoot.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Asteroids.Model; 4 | using UnityEngine.SceneManagement; 5 | 6 | namespace CompositeRoot 7 | { 8 | public class PhysicsRoutingCompositeRoot : CompositeRoot 9 | { 10 | [SerializeField] private EnemiesCompositeRoot _enemiesRoot; 11 | [SerializeField] private ShipCompositeRoot _shipRoot; 12 | [SerializeField] private EndGameWindowView _endGameWindow; 13 | [SerializeField] private PhysicsEventsBroadcaster _shipEventsBroadcaster; 14 | 15 | private PhysicsRouter _router; 16 | private CollisionsRecords _records; 17 | 18 | public PhysicsRouter Model => _router; 19 | 20 | public override void Compose() 21 | { 22 | _records = new CollisionsRecords(_shipRoot.Bullets, _enemiesRoot.Simulation); 23 | _router = new PhysicsRouter(_records.Values); 24 | _shipEventsBroadcaster.Init(_router, _shipRoot.Model); 25 | 26 | StartCoroutine(GetRouterSteper()); 27 | } 28 | 29 | private void OnEnable() 30 | { 31 | _records.GameEnd += OnGameEnd; 32 | } 33 | 34 | private void OnDisable() 35 | { 36 | _records.GameEnd -= OnGameEnd; 37 | } 38 | 39 | private void OnGameEnd() 40 | { 41 | _shipRoot.DisableShip(); 42 | 43 | _endGameWindow.Show(0, () => 44 | { 45 | SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); 46 | }); 47 | } 48 | 49 | private IEnumerator GetRouterSteper() 50 | { 51 | while (true) 52 | { 53 | yield return new WaitForFixedUpdate(); 54 | _router.Step(); 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.sprite": "1.0.0", 4 | "com.unity.collab-proxy": "1.7.1", 5 | "com.unity.ide.rider": "3.0.7", 6 | "com.unity.ide.visualstudio": "2.0.11", 7 | "com.unity.ide.vscode": "1.2.3", 8 | "com.unity.inputsystem": "1.0.2", 9 | "com.unity.test-framework": "1.1.27", 10 | "com.unity.textmeshpro": "3.0.6", 11 | "com.unity.timeline": "1.5.6", 12 | "com.unity.ugui": "1.0.0", 13 | "com.unity.visualscripting": "1.6.1", 14 | "com.unity.modules.ai": "1.0.0", 15 | "com.unity.modules.androidjni": "1.0.0", 16 | "com.unity.modules.animation": "1.0.0", 17 | "com.unity.modules.assetbundle": "1.0.0", 18 | "com.unity.modules.audio": "1.0.0", 19 | "com.unity.modules.cloth": "1.0.0", 20 | "com.unity.modules.director": "1.0.0", 21 | "com.unity.modules.imageconversion": "1.0.0", 22 | "com.unity.modules.imgui": "1.0.0", 23 | "com.unity.modules.jsonserialize": "1.0.0", 24 | "com.unity.modules.particlesystem": "1.0.0", 25 | "com.unity.modules.physics": "1.0.0", 26 | "com.unity.modules.physics2d": "1.0.0", 27 | "com.unity.modules.screencapture": "1.0.0", 28 | "com.unity.modules.terrain": "1.0.0", 29 | "com.unity.modules.terrainphysics": "1.0.0", 30 | "com.unity.modules.tilemap": "1.0.0", 31 | "com.unity.modules.ui": "1.0.0", 32 | "com.unity.modules.uielements": "1.0.0", 33 | "com.unity.modules.umbra": "1.0.0", 34 | "com.unity.modules.unityanalytics": "1.0.0", 35 | "com.unity.modules.unitywebrequest": "1.0.0", 36 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 37 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 38 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 39 | "com.unity.modules.unitywebrequestwww": "1.0.0", 40 | "com.unity.modules.vehicles": "1.0.0", 41 | "com.unity.modules.video": "1.0.0", 42 | "com.unity.modules.vr": "1.0.0", 43 | "com.unity.modules.wind": "1.0.0", 44 | "com.unity.modules.xr": "1.0.0" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /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/Sources/Input/ShipInputRouter.cs: -------------------------------------------------------------------------------- 1 | using Asteroids.Input; 2 | using Asteroids.Model; 3 | using UnityEngine; 4 | using UnityEngine.InputSystem; 5 | 6 | public class ShipInputRouter 7 | { 8 | private ShipInput _input; 9 | private InertMovement _inertMovement; 10 | private ShipMovement _shipMovement; 11 | 12 | private DefaultGun _firstGunSlot; 13 | private DefaultGun _secondGunSlot; 14 | 15 | public float Speed => _inertMovement.Acceleration.magnitude; 16 | 17 | public ShipInputRouter(ShipMovement shipMovement) 18 | { 19 | _input = new ShipInput(); 20 | _inertMovement = new InertMovement(); 21 | _shipMovement = shipMovement; 22 | } 23 | 24 | public void OnEnable() 25 | { 26 | _input.Enable(); 27 | _input.Ship.FirstSlotShoot.performed += OnFirstSlootShoot; 28 | _input.Ship.SecondSlotShoot.performed += OnSecondSlootShoot; 29 | } 30 | 31 | public void OnDisable() 32 | { 33 | _input.Disable(); 34 | _input.Ship.FirstSlotShoot.performed -= OnFirstSlootShoot; 35 | _input.Ship.SecondSlotShoot.performed -= OnSecondSlootShoot; 36 | } 37 | 38 | public void Update() 39 | { 40 | if (MoveForwardPerformed()) 41 | _inertMovement.Accelerate(_shipMovement.Forward, Time.deltaTime); 42 | else 43 | _inertMovement.Slowdown(Time.deltaTime); 44 | 45 | _shipMovement.Move(_inertMovement.Acceleration); 46 | TryRotate(); 47 | } 48 | 49 | public ShipInputRouter BindGunToFirstSlot(DefaultGun gun) 50 | { 51 | _firstGunSlot = gun; 52 | return this; 53 | } 54 | 55 | public ShipInputRouter BindGunToSecondSlot(DefaultGun gun) 56 | { 57 | _secondGunSlot = gun; 58 | return this; 59 | } 60 | 61 | private bool MoveForwardPerformed() 62 | { 63 | return _input.Ship.MoveForward.phase == InputActionPhase.Performed; 64 | } 65 | 66 | private void OnFirstSlootShoot(InputAction.CallbackContext obj) 67 | { 68 | TryShoot(_firstGunSlot); 69 | } 70 | 71 | private void OnSecondSlootShoot(InputAction.CallbackContext obj) 72 | { 73 | TryShoot(_secondGunSlot); 74 | } 75 | 76 | private void TryShoot(DefaultGun gun) 77 | { 78 | if (gun.CanShoot()) 79 | gun.Shoot(); 80 | } 81 | 82 | private void TryRotate() 83 | { 84 | float direction = _input.Ship.Rotate.ReadValue(); 85 | 86 | if(direction != 0) 87 | _shipMovement.Rotate(direction, Time.deltaTime); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Assets/Sources/Model/Simulations/EnemiesSpawner.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using Random = UnityEngine.Random; 5 | 6 | namespace Asteroids.Model 7 | { 8 | public class EnemiesSpawner 9 | { 10 | private readonly EnemiesSimulation _simulation; 11 | private readonly Transformable _player; 12 | 13 | private readonly Func[] _variants; 14 | private readonly Timers> _queue = new Timers>(); 15 | 16 | public EnemiesSpawner(EnemiesSimulation simulation, Transformable player) 17 | { 18 | _simulation = simulation; 19 | _player = player; 20 | 21 | _variants = new Func[] 22 | { 23 | CreateAsteroid, 24 | CreateNlo 25 | }; 26 | } 27 | 28 | public void FillTestQueue() 29 | { 30 | for (int stacks = 0; stacks < 100; stacks++) 31 | { 32 | int countInStack = Random.Range(0, 2); 33 | 34 | while(countInStack-- > 0) 35 | _queue.Start(_variants[0], stacks * 2, (factory) => _simulation.Simulate(factory.Invoke())); 36 | } 37 | 38 | _queue.Start(_variants[1], 1, (factory) => _simulation.Simulate(factory.Invoke())); 39 | _queue.Start(_variants[1], 7, (factory) => _simulation.Simulate(factory.Invoke())); 40 | _queue.Start(_variants[1], 7, (factory) => _simulation.Simulate(factory.Invoke())); 41 | _queue.Start(_variants[1], 16, (factory) => _simulation.Simulate(factory.Invoke())); 42 | _queue.Start(_variants[1], 25, (factory) => _simulation.Simulate(factory.Invoke())); 43 | } 44 | 45 | public void Update(float deltaTime) 46 | { 47 | _queue.Tick(deltaTime); 48 | } 49 | 50 | private Vector2 GetRandomPositionOutsideScreen() 51 | { 52 | return Random.insideUnitCircle.normalized + new Vector2(0.5F, 0.5F); 53 | } 54 | 55 | private Nlo CreateNlo() 56 | { 57 | return new Nlo(_player, GetRandomPositionOutsideScreen(), Config.NloSpeed); 58 | } 59 | 60 | private Asteroid CreateAsteroid() 61 | { 62 | Vector2 postion = GetRandomPositionOutsideScreen(); 63 | Vector2 direction = GetDirectionThroughtScreen(postion); 64 | 65 | return new Asteroid(postion, direction, Config.AsteroidSpeed); 66 | } 67 | 68 | private static Vector2 GetDirectionThroughtScreen(Vector2 postion) 69 | { 70 | return (new Vector2(Random.value, Random.value) - postion).normalized; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /Assets/Sources/Model/PhysicsRouter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Asteroids.Model 6 | { 7 | public class PhysicsRouter 8 | { 9 | private Collisions _collisions = new Collisions(); 10 | 11 | private readonly Func> _recordsProvider; 12 | 13 | public PhysicsRouter(Func> recordsProvider) 14 | { 15 | _recordsProvider = recordsProvider; 16 | } 17 | 18 | public void TryAddCollision(object modelA, object modelB) 19 | { 20 | _collisions.TryBind(modelA, modelB); 21 | } 22 | 23 | public void Step() 24 | { 25 | foreach (var pair in _collisions.Pairs) 26 | TryRoute(pair); 27 | 28 | _collisions = new Collisions(); 29 | } 30 | 31 | public void TryRoute((object, object) pair) 32 | { 33 | IEnumerable records = _recordsProvider?.Invoke().Where(record => record.IsTarget(pair)); 34 | 35 | foreach (var record in records) 36 | ((dynamic)record).Do((dynamic)pair.Item1, (dynamic)pair.Item2); 37 | } 38 | 39 | public abstract class Record 40 | { 41 | public abstract bool IsTarget((object, object) pair); 42 | } 43 | 44 | public sealed class Record : Record 45 | { 46 | public readonly Action Action; 47 | 48 | public Record(Action action) 49 | { 50 | Action = action; 51 | } 52 | 53 | public void Do(T1 a, T2 b) 54 | { 55 | Action(a, b); 56 | } 57 | 58 | public void Do(T2 b, T1 a) 59 | { 60 | Action(a, b); 61 | } 62 | 63 | public override bool IsTarget((object, object) pair) 64 | { 65 | if (pair.Item1 is T1 && pair.Item2 is T2) 66 | return true; 67 | 68 | if (pair.Item1 is T2 && pair.Item2 is T1) 69 | return true; 70 | 71 | return false; 72 | } 73 | } 74 | 75 | private class Collisions 76 | { 77 | private List<(object, object)> _pairs = new List<(object, object)>(); 78 | 79 | public IEnumerable<(object, object)> Pairs => _pairs; 80 | 81 | public void TryBind(object a, object b) 82 | { 83 | foreach (var (left, right) in _pairs) 84 | { 85 | if (left == a && right == b) 86 | return; 87 | 88 | if (left == b && right == a) 89 | return; 90 | } 91 | 92 | _pairs.Add((a, b)); 93 | } 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Assets/Sources/CompositeRoot/ShipCompositeRoot.cs: -------------------------------------------------------------------------------- 1 | using Asteroids.Input; 2 | using Asteroids.Model; 3 | using System; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | using UnityEngine.InputSystem; 7 | 8 | namespace CompositeRoot 9 | { 10 | public class ShipCompositeRoot : CompositeRoot 11 | { 12 | [SerializeField] private TransformableView _transformableView; 13 | [SerializeField] private BulletsViewFactory _bulletsViewFactory; 14 | [SerializeField] private Camera _camera; 15 | 16 | private Ship _shipModel; 17 | private ShipInputRouter _shipInputRouter; 18 | private ShipMovement _shipMovement; 19 | private DefaultGun _baseGun; 20 | private LaserGun _laserGun; 21 | private BulletsSimulation _bulletsSimulation; 22 | private LaserGunRollback _laserGunRollback; 23 | 24 | public Ship Model => _shipModel; 25 | public BulletsSimulation Bullets => _bulletsSimulation; 26 | public float Speed => _shipInputRouter.Speed; 27 | public LaserGun LaserGun => _laserGun; 28 | public LaserGunRollback LaserGunRollback => _laserGunRollback; 29 | 30 | public override void Compose() 31 | { 32 | _baseGun = new DefaultGun(); 33 | _laserGun = new LaserGun(10); 34 | 35 | _shipModel = new Ship(new Vector2(0.5f, 0.5f), 0); 36 | _shipMovement = new ShipMovement(_shipModel); 37 | _shipInputRouter = new ShipInputRouter(_shipMovement) 38 | .BindGunToFirstSlot(_baseGun) 39 | .BindGunToSecondSlot(_laserGun); 40 | 41 | _transformableView.Init(_shipModel, _camera); 42 | 43 | _bulletsSimulation = new BulletsSimulation(); 44 | _laserGunRollback = new LaserGunRollback(_laserGun, Config.LaserCooldown); 45 | } 46 | 47 | public void DisableShip() 48 | { 49 | _shipInputRouter.OnDisable(); 50 | } 51 | 52 | private void OnEnable() 53 | { 54 | _shipInputRouter.OnEnable(); 55 | 56 | _baseGun.Shot += OnShot; 57 | _laserGun.Shot += OnShot; 58 | 59 | _bulletsSimulation.Start += _bulletsViewFactory.Create; 60 | _bulletsSimulation.End += _bulletsViewFactory.Destroy; 61 | } 62 | 63 | private void OnDisable() 64 | { 65 | _shipInputRouter.OnDisable(); 66 | 67 | _baseGun.Shot -= OnShot; 68 | _laserGun.Shot -= OnShot; 69 | 70 | _bulletsSimulation.Start -= _bulletsViewFactory.Create; 71 | _bulletsSimulation.End -= _bulletsViewFactory.Destroy; 72 | } 73 | 74 | private void Update() 75 | { 76 | _shipInputRouter.Update(); 77 | _bulletsSimulation.Update(Time.deltaTime); 78 | _laserGunRollback.Tick(Time.deltaTime); 79 | } 80 | 81 | private void OnShot(Bullet bullet) 82 | { 83 | _bulletsSimulation.Simulate(bullet, _shipModel.Position, _shipMovement.Forward); 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /Assets/Prefabs/Nlo.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &1257215321222328127 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: 8086458981623050168} 12 | - component: {fileID: 1705207017474855458} 13 | - component: {fileID: 5144605620924001717} 14 | - component: {fileID: -598369408570872661} 15 | - component: {fileID: 9025297964206478296} 16 | m_Layer: 0 17 | m_Name: Nlo 18 | m_TagString: Untagged 19 | m_Icon: {fileID: 0} 20 | m_NavMeshLayer: 0 21 | m_StaticEditorFlags: 0 22 | m_IsActive: 1 23 | --- !u!4 &8086458981623050168 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: 1257215321222328127} 30 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 31 | m_LocalPosition: {x: 11.372212, y: -0.99211025, z: 0} 32 | m_LocalScale: {x: 1, 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!212 &1705207017474855458 38 | SpriteRenderer: 39 | m_ObjectHideFlags: 0 40 | m_CorrespondingSourceObject: {fileID: 0} 41 | m_PrefabInstance: {fileID: 0} 42 | m_PrefabAsset: {fileID: 0} 43 | m_GameObject: {fileID: 1257215321222328127} 44 | m_Enabled: 1 45 | m_CastShadows: 0 46 | m_ReceiveShadows: 0 47 | m_DynamicOccludee: 1 48 | m_StaticShadowCaster: 0 49 | m_MotionVectors: 1 50 | m_LightProbeUsage: 1 51 | m_ReflectionProbeUsage: 1 52 | m_RayTracingMode: 0 53 | m_RayTraceProcedural: 0 54 | m_RenderingLayerMask: 1 55 | m_RendererPriority: 0 56 | m_Materials: 57 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 58 | m_StaticBatchInfo: 59 | firstSubMesh: 0 60 | subMeshCount: 0 61 | m_StaticBatchRoot: {fileID: 0} 62 | m_ProbeAnchor: {fileID: 0} 63 | m_LightProbeVolumeOverride: {fileID: 0} 64 | m_ScaleInLightmap: 1 65 | m_ReceiveGI: 1 66 | m_PreserveUVs: 0 67 | m_IgnoreNormalsForChartDetection: 0 68 | m_ImportantGI: 0 69 | m_StitchLightmapSeams: 1 70 | m_SelectedEditorRenderState: 0 71 | m_MinimumChartSize: 4 72 | m_AutoUVMaxDistance: 0.5 73 | m_AutoUVMaxAngle: 89 74 | m_LightmapParameters: {fileID: 0} 75 | m_SortingLayerID: 0 76 | m_SortingLayer: 0 77 | m_SortingOrder: 0 78 | m_Sprite: {fileID: 2977310587539912664, guid: 0796d67a60cabb34b96c213dcdb7156a, type: 3} 79 | m_Color: {r: 1, g: 1, b: 1, a: 1} 80 | m_FlipX: 0 81 | m_FlipY: 0 82 | m_DrawMode: 0 83 | m_Size: {x: 0.64, y: 0.92} 84 | m_AdaptiveModeThreshold: 0.5 85 | m_SpriteTileMode: 0 86 | m_WasSpriteAssigned: 1 87 | m_MaskInteraction: 0 88 | m_SpriteSortPoint: 0 89 | --- !u!114 &5144605620924001717 90 | MonoBehaviour: 91 | m_ObjectHideFlags: 0 92 | m_CorrespondingSourceObject: {fileID: 0} 93 | m_PrefabInstance: {fileID: 0} 94 | m_PrefabAsset: {fileID: 0} 95 | m_GameObject: {fileID: 1257215321222328127} 96 | m_Enabled: 1 97 | m_EditorHideFlags: 0 98 | m_Script: {fileID: 11500000, guid: 64bef8e5aef082e4fb2813f02d1368c5, type: 3} 99 | m_Name: 100 | m_EditorClassIdentifier: 101 | --- !u!114 &-598369408570872661 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: 1257215321222328127} 108 | m_Enabled: 1 109 | m_EditorHideFlags: 0 110 | m_Script: {fileID: 11500000, guid: f191ce631aab81249ad8b0564e585177, type: 3} 111 | m_Name: 112 | m_EditorClassIdentifier: 113 | --- !u!61 &9025297964206478296 114 | BoxCollider2D: 115 | m_ObjectHideFlags: 0 116 | m_CorrespondingSourceObject: {fileID: 0} 117 | m_PrefabInstance: {fileID: 0} 118 | m_PrefabAsset: {fileID: 0} 119 | m_GameObject: {fileID: 1257215321222328127} 120 | m_Enabled: 1 121 | m_Density: 1 122 | m_Material: {fileID: 0} 123 | m_IsTrigger: 0 124 | m_UsedByEffector: 0 125 | m_UsedByComposite: 0 126 | m_Offset: {x: 0, y: 0} 127 | m_SpriteTilingProperty: 128 | border: {x: 0, y: 0, z: 0, w: 0} 129 | pivot: {x: 0.5, y: 0.5} 130 | oldSize: {x: 0.64, y: 0.92} 131 | newSize: {x: 0.64, y: 0.92} 132 | adaptiveTilingThreshold: 0.5 133 | drawMode: 0 134 | adaptiveTiling: 0 135 | m_AutoTiling: 0 136 | serializedVersion: 2 137 | m_Size: {x: 0.64, y: 0.92} 138 | m_EdgeRadius: 0 139 | -------------------------------------------------------------------------------- /Assets/Prefabs/Asteroid.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &3171799439231359836 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: 7250654019418433372} 12 | - component: {fileID: 5714051690309574898} 13 | - component: {fileID: 8242772678581347395} 14 | - component: {fileID: -8311170272671437324} 15 | - component: {fileID: 6020861953111671804} 16 | m_Layer: 0 17 | m_Name: Asteroid 18 | m_TagString: Untagged 19 | m_Icon: {fileID: 0} 20 | m_NavMeshLayer: 0 21 | m_StaticEditorFlags: 0 22 | m_IsActive: 1 23 | --- !u!4 &7250654019418433372 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: 3171799439231359836} 30 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 31 | m_LocalPosition: {x: 7.7473083, y: -0.13622999, z: 0} 32 | m_LocalScale: {x: 1, 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!212 &5714051690309574898 38 | SpriteRenderer: 39 | m_ObjectHideFlags: 0 40 | m_CorrespondingSourceObject: {fileID: 0} 41 | m_PrefabInstance: {fileID: 0} 42 | m_PrefabAsset: {fileID: 0} 43 | m_GameObject: {fileID: 3171799439231359836} 44 | m_Enabled: 1 45 | m_CastShadows: 0 46 | m_ReceiveShadows: 0 47 | m_DynamicOccludee: 1 48 | m_StaticShadowCaster: 0 49 | m_MotionVectors: 1 50 | m_LightProbeUsage: 1 51 | m_ReflectionProbeUsage: 1 52 | m_RayTracingMode: 0 53 | m_RayTraceProcedural: 0 54 | m_RenderingLayerMask: 1 55 | m_RendererPriority: 0 56 | m_Materials: 57 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 58 | m_StaticBatchInfo: 59 | firstSubMesh: 0 60 | subMeshCount: 0 61 | m_StaticBatchRoot: {fileID: 0} 62 | m_ProbeAnchor: {fileID: 0} 63 | m_LightProbeVolumeOverride: {fileID: 0} 64 | m_ScaleInLightmap: 1 65 | m_ReceiveGI: 1 66 | m_PreserveUVs: 0 67 | m_IgnoreNormalsForChartDetection: 0 68 | m_ImportantGI: 0 69 | m_StitchLightmapSeams: 1 70 | m_SelectedEditorRenderState: 0 71 | m_MinimumChartSize: 4 72 | m_AutoUVMaxDistance: 0.5 73 | m_AutoUVMaxAngle: 89 74 | m_LightmapParameters: {fileID: 0} 75 | m_SortingLayerID: 0 76 | m_SortingLayer: 0 77 | m_SortingOrder: 0 78 | m_Sprite: {fileID: -1631521915477014264, guid: 0796d67a60cabb34b96c213dcdb7156a, type: 3} 79 | m_Color: {r: 1, g: 1, b: 1, a: 1} 80 | m_FlipX: 0 81 | m_FlipY: 0 82 | m_DrawMode: 0 83 | m_Size: {x: 2.32, y: 2.44} 84 | m_AdaptiveModeThreshold: 0.5 85 | m_SpriteTileMode: 0 86 | m_WasSpriteAssigned: 1 87 | m_MaskInteraction: 0 88 | m_SpriteSortPoint: 0 89 | --- !u!114 &8242772678581347395 90 | MonoBehaviour: 91 | m_ObjectHideFlags: 0 92 | m_CorrespondingSourceObject: {fileID: 0} 93 | m_PrefabInstance: {fileID: 0} 94 | m_PrefabAsset: {fileID: 0} 95 | m_GameObject: {fileID: 3171799439231359836} 96 | m_Enabled: 1 97 | m_EditorHideFlags: 0 98 | m_Script: {fileID: 11500000, guid: 64bef8e5aef082e4fb2813f02d1368c5, type: 3} 99 | m_Name: 100 | m_EditorClassIdentifier: 101 | --- !u!114 &-8311170272671437324 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: 3171799439231359836} 108 | m_Enabled: 1 109 | m_EditorHideFlags: 0 110 | m_Script: {fileID: 11500000, guid: f191ce631aab81249ad8b0564e585177, type: 3} 111 | m_Name: 112 | m_EditorClassIdentifier: 113 | --- !u!61 &6020861953111671804 114 | BoxCollider2D: 115 | m_ObjectHideFlags: 0 116 | m_CorrespondingSourceObject: {fileID: 0} 117 | m_PrefabInstance: {fileID: 0} 118 | m_PrefabAsset: {fileID: 0} 119 | m_GameObject: {fileID: 3171799439231359836} 120 | m_Enabled: 1 121 | m_Density: 1 122 | m_Material: {fileID: 0} 123 | m_IsTrigger: 0 124 | m_UsedByEffector: 0 125 | m_UsedByComposite: 0 126 | m_Offset: {x: 0, y: 0} 127 | m_SpriteTilingProperty: 128 | border: {x: 0, y: 0, z: 0, w: 0} 129 | pivot: {x: 0.5, y: 0.5} 130 | oldSize: {x: 2.32, y: 2.44} 131 | newSize: {x: 2.32, y: 2.44} 132 | adaptiveTilingThreshold: 0.5 133 | drawMode: 0 134 | adaptiveTiling: 0 135 | m_AutoTiling: 0 136 | serializedVersion: 2 137 | m_Size: {x: 2.32, y: 2.44} 138 | m_EdgeRadius: 0 139 | -------------------------------------------------------------------------------- /Assets/Prefabs/PartOfAsteroid.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &1925244715059698992 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: 8513689060844425626} 12 | - component: {fileID: 4859352781435603867} 13 | - component: {fileID: 1457799033967114595} 14 | - component: {fileID: -5298835431683761873} 15 | - component: {fileID: -3650073490644315261} 16 | m_Layer: 0 17 | m_Name: PartOfAsteroid 18 | m_TagString: Untagged 19 | m_Icon: {fileID: 0} 20 | m_NavMeshLayer: 0 21 | m_StaticEditorFlags: 0 22 | m_IsActive: 1 23 | --- !u!4 &8513689060844425626 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: 1925244715059698992} 30 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 31 | m_LocalPosition: {x: 6.3124504, y: -1.6969526, z: 0} 32 | m_LocalScale: {x: 1, 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!212 &4859352781435603867 38 | SpriteRenderer: 39 | m_ObjectHideFlags: 0 40 | m_CorrespondingSourceObject: {fileID: 0} 41 | m_PrefabInstance: {fileID: 0} 42 | m_PrefabAsset: {fileID: 0} 43 | m_GameObject: {fileID: 1925244715059698992} 44 | m_Enabled: 1 45 | m_CastShadows: 0 46 | m_ReceiveShadows: 0 47 | m_DynamicOccludee: 1 48 | m_StaticShadowCaster: 0 49 | m_MotionVectors: 1 50 | m_LightProbeUsage: 1 51 | m_ReflectionProbeUsage: 1 52 | m_RayTracingMode: 0 53 | m_RayTraceProcedural: 0 54 | m_RenderingLayerMask: 1 55 | m_RendererPriority: 0 56 | m_Materials: 57 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 58 | m_StaticBatchInfo: 59 | firstSubMesh: 0 60 | subMeshCount: 0 61 | m_StaticBatchRoot: {fileID: 0} 62 | m_ProbeAnchor: {fileID: 0} 63 | m_LightProbeVolumeOverride: {fileID: 0} 64 | m_ScaleInLightmap: 1 65 | m_ReceiveGI: 1 66 | m_PreserveUVs: 0 67 | m_IgnoreNormalsForChartDetection: 0 68 | m_ImportantGI: 0 69 | m_StitchLightmapSeams: 1 70 | m_SelectedEditorRenderState: 0 71 | m_MinimumChartSize: 4 72 | m_AutoUVMaxDistance: 0.5 73 | m_AutoUVMaxAngle: 89 74 | m_LightmapParameters: {fileID: 0} 75 | m_SortingLayerID: 0 76 | m_SortingLayer: 0 77 | m_SortingOrder: 0 78 | m_Sprite: {fileID: -8758211774284209605, guid: 0796d67a60cabb34b96c213dcdb7156a, type: 3} 79 | m_Color: {r: 1, g: 1, b: 1, a: 1} 80 | m_FlipX: 0 81 | m_FlipY: 0 82 | m_DrawMode: 0 83 | m_Size: {x: 1.04, y: 1} 84 | m_AdaptiveModeThreshold: 0.5 85 | m_SpriteTileMode: 0 86 | m_WasSpriteAssigned: 1 87 | m_MaskInteraction: 0 88 | m_SpriteSortPoint: 0 89 | --- !u!114 &1457799033967114595 90 | MonoBehaviour: 91 | m_ObjectHideFlags: 0 92 | m_CorrespondingSourceObject: {fileID: 0} 93 | m_PrefabInstance: {fileID: 0} 94 | m_PrefabAsset: {fileID: 0} 95 | m_GameObject: {fileID: 1925244715059698992} 96 | m_Enabled: 1 97 | m_EditorHideFlags: 0 98 | m_Script: {fileID: 11500000, guid: 64bef8e5aef082e4fb2813f02d1368c5, type: 3} 99 | m_Name: 100 | m_EditorClassIdentifier: 101 | --- !u!114 &-5298835431683761873 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: 1925244715059698992} 108 | m_Enabled: 1 109 | m_EditorHideFlags: 0 110 | m_Script: {fileID: 11500000, guid: f191ce631aab81249ad8b0564e585177, type: 3} 111 | m_Name: 112 | m_EditorClassIdentifier: 113 | --- !u!61 &-3650073490644315261 114 | BoxCollider2D: 115 | m_ObjectHideFlags: 0 116 | m_CorrespondingSourceObject: {fileID: 0} 117 | m_PrefabInstance: {fileID: 0} 118 | m_PrefabAsset: {fileID: 0} 119 | m_GameObject: {fileID: 1925244715059698992} 120 | m_Enabled: 1 121 | m_Density: 1 122 | m_Material: {fileID: 0} 123 | m_IsTrigger: 0 124 | m_UsedByEffector: 0 125 | m_UsedByComposite: 0 126 | m_Offset: {x: 0, y: 0} 127 | m_SpriteTilingProperty: 128 | border: {x: 0, y: 0, z: 0, w: 0} 129 | pivot: {x: 0.5, y: 0.5} 130 | oldSize: {x: 1.04, y: 1} 131 | newSize: {x: 1.04, y: 1} 132 | adaptiveTilingThreshold: 0.5 133 | drawMode: 0 134 | adaptiveTiling: 0 135 | m_AutoTiling: 0 136 | serializedVersion: 2 137 | m_Size: {x: 1.04, y: 1} 138 | m_EdgeRadius: 0 139 | -------------------------------------------------------------------------------- /Assets/Sources/Input/ShipInput.inputactions: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ShipInput", 3 | "maps": [ 4 | { 5 | "name": "Ship", 6 | "id": "057b7762-5199-4552-a4c1-0bc83990bfbc", 7 | "actions": [ 8 | { 9 | "name": "MoveForward", 10 | "type": "Button", 11 | "id": "a5734cbb-66d0-4b66-8a79-5fbc7f23696d", 12 | "expectedControlType": "Button", 13 | "processors": "", 14 | "interactions": "" 15 | }, 16 | { 17 | "name": "FirstSlotShoot", 18 | "type": "Button", 19 | "id": "db44999b-b1f5-43e2-8e24-479fee798b4e", 20 | "expectedControlType": "Button", 21 | "processors": "", 22 | "interactions": "" 23 | }, 24 | { 25 | "name": "SecondSlotShoot", 26 | "type": "Button", 27 | "id": "424ade2a-7918-4c84-8745-ab275bd4a60c", 28 | "expectedControlType": "Button", 29 | "processors": "", 30 | "interactions": "" 31 | }, 32 | { 33 | "name": "Rotate", 34 | "type": "Value", 35 | "id": "14f05330-31ac-4537-8288-d39dc249aeeb", 36 | "expectedControlType": "", 37 | "processors": "", 38 | "interactions": "" 39 | } 40 | ], 41 | "bindings": [ 42 | { 43 | "name": "", 44 | "id": "8fcf2221-66b5-47df-8b9d-f17d8a252368", 45 | "path": "/w", 46 | "interactions": "Hold(duration=0.001,pressPoint=0.001)", 47 | "processors": "", 48 | "groups": "", 49 | "action": "MoveForward", 50 | "isComposite": false, 51 | "isPartOfComposite": false 52 | }, 53 | { 54 | "name": "", 55 | "id": "aa03d3d8-7663-4d47-8972-43fdb4f324ac", 56 | "path": "/q", 57 | "interactions": "", 58 | "processors": "", 59 | "groups": "", 60 | "action": "FirstSlotShoot", 61 | "isComposite": false, 62 | "isPartOfComposite": false 63 | }, 64 | { 65 | "name": "", 66 | "id": "d1d9e4db-49df-4050-8c52-775be950a253", 67 | "path": "/e", 68 | "interactions": "", 69 | "processors": "", 70 | "groups": "", 71 | "action": "SecondSlotShoot", 72 | "isComposite": false, 73 | "isPartOfComposite": false 74 | }, 75 | { 76 | "name": "Direction", 77 | "id": "ca7ac779-c41f-42ad-aeda-565f48879850", 78 | "path": "1DAxis", 79 | "interactions": "", 80 | "processors": "Invert", 81 | "groups": "", 82 | "action": "Rotate", 83 | "isComposite": true, 84 | "isPartOfComposite": false 85 | }, 86 | { 87 | "name": "negative", 88 | "id": "02f47a46-655b-45f2-9d92-f28adde1e988", 89 | "path": "/a", 90 | "interactions": "", 91 | "processors": "", 92 | "groups": "", 93 | "action": "Rotate", 94 | "isComposite": false, 95 | "isPartOfComposite": true 96 | }, 97 | { 98 | "name": "positive", 99 | "id": "64ecaf39-7d68-4106-80b7-0df12a9cda4c", 100 | "path": "/d", 101 | "interactions": "", 102 | "processors": "", 103 | "groups": "", 104 | "action": "Rotate", 105 | "isComposite": false, 106 | "isPartOfComposite": true 107 | } 108 | ] 109 | } 110 | ], 111 | "controlSchemes": [] 112 | } -------------------------------------------------------------------------------- /Assets/Prefabs/Bullet.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &6178685449458686511 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: 6336307130596380267} 12 | - component: {fileID: 4010392742162841418} 13 | - component: {fileID: -2268125191792454124} 14 | - component: {fileID: -1032894085338730031} 15 | - component: {fileID: -8637165461172132700} 16 | - component: {fileID: -8293092383851476959} 17 | m_Layer: 0 18 | m_Name: Bullet 19 | m_TagString: Untagged 20 | m_Icon: {fileID: 0} 21 | m_NavMeshLayer: 0 22 | m_StaticEditorFlags: 0 23 | m_IsActive: 1 24 | --- !u!4 &6336307130596380267 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: 6178685449458686511} 31 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 32 | m_LocalPosition: {x: 0, y: 0, z: 0} 33 | m_LocalScale: {x: 1, y: 1, z: 1} 34 | m_Children: [] 35 | m_Father: {fileID: 0} 36 | m_RootOrder: 0 37 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 38 | --- !u!212 &4010392742162841418 39 | SpriteRenderer: 40 | m_ObjectHideFlags: 0 41 | m_CorrespondingSourceObject: {fileID: 0} 42 | m_PrefabInstance: {fileID: 0} 43 | m_PrefabAsset: {fileID: 0} 44 | m_GameObject: {fileID: 6178685449458686511} 45 | m_Enabled: 1 46 | m_CastShadows: 0 47 | m_ReceiveShadows: 0 48 | m_DynamicOccludee: 1 49 | m_StaticShadowCaster: 0 50 | m_MotionVectors: 1 51 | m_LightProbeUsage: 1 52 | m_ReflectionProbeUsage: 1 53 | m_RayTracingMode: 0 54 | m_RayTraceProcedural: 0 55 | m_RenderingLayerMask: 1 56 | m_RendererPriority: 0 57 | m_Materials: 58 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 59 | m_StaticBatchInfo: 60 | firstSubMesh: 0 61 | subMeshCount: 0 62 | m_StaticBatchRoot: {fileID: 0} 63 | m_ProbeAnchor: {fileID: 0} 64 | m_LightProbeVolumeOverride: {fileID: 0} 65 | m_ScaleInLightmap: 1 66 | m_ReceiveGI: 1 67 | m_PreserveUVs: 0 68 | m_IgnoreNormalsForChartDetection: 0 69 | m_ImportantGI: 0 70 | m_StitchLightmapSeams: 1 71 | m_SelectedEditorRenderState: 0 72 | m_MinimumChartSize: 4 73 | m_AutoUVMaxDistance: 0.5 74 | m_AutoUVMaxAngle: 89 75 | m_LightmapParameters: {fileID: 0} 76 | m_SortingLayerID: 0 77 | m_SortingLayer: 0 78 | m_SortingOrder: 0 79 | m_Sprite: {fileID: 7929229843044202141, guid: 0796d67a60cabb34b96c213dcdb7156a, type: 3} 80 | m_Color: {r: 1, g: 1, b: 1, a: 1} 81 | m_FlipX: 0 82 | m_FlipY: 0 83 | m_DrawMode: 0 84 | m_Size: {x: 0.24, y: 0.2} 85 | m_AdaptiveModeThreshold: 0.5 86 | m_SpriteTileMode: 0 87 | m_WasSpriteAssigned: 1 88 | m_MaskInteraction: 0 89 | m_SpriteSortPoint: 0 90 | --- !u!114 &-2268125191792454124 91 | MonoBehaviour: 92 | m_ObjectHideFlags: 0 93 | m_CorrespondingSourceObject: {fileID: 0} 94 | m_PrefabInstance: {fileID: 0} 95 | m_PrefabAsset: {fileID: 0} 96 | m_GameObject: {fileID: 6178685449458686511} 97 | m_Enabled: 1 98 | m_EditorHideFlags: 0 99 | m_Script: {fileID: 11500000, guid: 64bef8e5aef082e4fb2813f02d1368c5, type: 3} 100 | m_Name: 101 | m_EditorClassIdentifier: 102 | --- !u!114 &-1032894085338730031 103 | MonoBehaviour: 104 | m_ObjectHideFlags: 0 105 | m_CorrespondingSourceObject: {fileID: 0} 106 | m_PrefabInstance: {fileID: 0} 107 | m_PrefabAsset: {fileID: 0} 108 | m_GameObject: {fileID: 6178685449458686511} 109 | m_Enabled: 1 110 | m_EditorHideFlags: 0 111 | m_Script: {fileID: 11500000, guid: f191ce631aab81249ad8b0564e585177, type: 3} 112 | m_Name: 113 | m_EditorClassIdentifier: 114 | --- !u!61 &-8637165461172132700 115 | BoxCollider2D: 116 | m_ObjectHideFlags: 0 117 | m_CorrespondingSourceObject: {fileID: 0} 118 | m_PrefabInstance: {fileID: 0} 119 | m_PrefabAsset: {fileID: 0} 120 | m_GameObject: {fileID: 6178685449458686511} 121 | m_Enabled: 1 122 | m_Density: 1 123 | m_Material: {fileID: 0} 124 | m_IsTrigger: 0 125 | m_UsedByEffector: 0 126 | m_UsedByComposite: 0 127 | m_Offset: {x: 0, y: 0} 128 | m_SpriteTilingProperty: 129 | border: {x: 0, y: 0, z: 0, w: 0} 130 | pivot: {x: 0.5, y: 0.5} 131 | oldSize: {x: 0.24, y: 0.2} 132 | newSize: {x: 0.24, y: 0.2} 133 | adaptiveTilingThreshold: 0.5 134 | drawMode: 0 135 | adaptiveTiling: 0 136 | m_AutoTiling: 0 137 | serializedVersion: 2 138 | m_Size: {x: 0.24, y: 0.2} 139 | m_EdgeRadius: 0 140 | --- !u!50 &-8293092383851476959 141 | Rigidbody2D: 142 | serializedVersion: 4 143 | m_ObjectHideFlags: 0 144 | m_CorrespondingSourceObject: {fileID: 0} 145 | m_PrefabInstance: {fileID: 0} 146 | m_PrefabAsset: {fileID: 0} 147 | m_GameObject: {fileID: 6178685449458686511} 148 | m_BodyType: 0 149 | m_Simulated: 1 150 | m_UseFullKinematicContacts: 0 151 | m_UseAutoMass: 0 152 | m_Mass: 1 153 | m_LinearDrag: 0 154 | m_AngularDrag: 0.05 155 | m_GravityScale: 1 156 | m_Material: {fileID: 0} 157 | m_Interpolate: 0 158 | m_SleepingMode: 1 159 | m_CollisionDetection: 0 160 | m_Constraints: 7 161 | -------------------------------------------------------------------------------- /Assets/Prefabs/Laser.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &7530022156930753192 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: 6478326181387952803} 12 | - component: {fileID: 8381023526363866301} 13 | - component: {fileID: 8864712561646273570} 14 | - component: {fileID: -937530412264702557} 15 | - component: {fileID: 2380316914952706091} 16 | - component: {fileID: 8233190670634332126} 17 | - component: {fileID: 8314589716755157351} 18 | m_Layer: 0 19 | m_Name: Laser 20 | m_TagString: Untagged 21 | m_Icon: {fileID: 0} 22 | m_NavMeshLayer: 0 23 | m_StaticEditorFlags: 0 24 | m_IsActive: 1 25 | --- !u!4 &6478326181387952803 26 | Transform: 27 | m_ObjectHideFlags: 0 28 | m_CorrespondingSourceObject: {fileID: 0} 29 | m_PrefabInstance: {fileID: 0} 30 | m_PrefabAsset: {fileID: 0} 31 | m_GameObject: {fileID: 7530022156930753192} 32 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 33 | m_LocalPosition: {x: -0, y: 0, z: 0} 34 | m_LocalScale: {x: 2, y: 15000, z: 1} 35 | m_Children: [] 36 | m_Father: {fileID: 0} 37 | m_RootOrder: 0 38 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 39 | --- !u!212 &8381023526363866301 40 | SpriteRenderer: 41 | m_ObjectHideFlags: 0 42 | m_CorrespondingSourceObject: {fileID: 0} 43 | m_PrefabInstance: {fileID: 0} 44 | m_PrefabAsset: {fileID: 0} 45 | m_GameObject: {fileID: 7530022156930753192} 46 | m_Enabled: 1 47 | m_CastShadows: 0 48 | m_ReceiveShadows: 0 49 | m_DynamicOccludee: 1 50 | m_StaticShadowCaster: 0 51 | m_MotionVectors: 1 52 | m_LightProbeUsage: 1 53 | m_ReflectionProbeUsage: 1 54 | m_RayTracingMode: 0 55 | m_RayTraceProcedural: 0 56 | m_RenderingLayerMask: 1 57 | m_RendererPriority: 0 58 | m_Materials: 59 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 60 | m_StaticBatchInfo: 61 | firstSubMesh: 0 62 | subMeshCount: 0 63 | m_StaticBatchRoot: {fileID: 0} 64 | m_ProbeAnchor: {fileID: 0} 65 | m_LightProbeVolumeOverride: {fileID: 0} 66 | m_ScaleInLightmap: 1 67 | m_ReceiveGI: 1 68 | m_PreserveUVs: 0 69 | m_IgnoreNormalsForChartDetection: 0 70 | m_ImportantGI: 0 71 | m_StitchLightmapSeams: 1 72 | m_SelectedEditorRenderState: 0 73 | m_MinimumChartSize: 4 74 | m_AutoUVMaxDistance: 0.5 75 | m_AutoUVMaxAngle: 89 76 | m_LightmapParameters: {fileID: 0} 77 | m_SortingLayerID: 0 78 | m_SortingLayer: 0 79 | m_SortingOrder: 0 80 | m_Sprite: {fileID: -5522339636744722164, guid: 0796d67a60cabb34b96c213dcdb7156a, type: 3} 81 | m_Color: {r: 1, g: 0.3915094, b: 0.3915094, a: 1} 82 | m_FlipX: 0 83 | m_FlipY: 0 84 | m_DrawMode: 0 85 | m_Size: {x: 0.24, y: 0.2} 86 | m_AdaptiveModeThreshold: 0.5 87 | m_SpriteTileMode: 0 88 | m_WasSpriteAssigned: 1 89 | m_MaskInteraction: 0 90 | m_SpriteSortPoint: 0 91 | --- !u!122 &8864712561646273570 92 | Halo: 93 | m_ObjectHideFlags: 0 94 | m_CorrespondingSourceObject: {fileID: 0} 95 | m_PrefabInstance: {fileID: 0} 96 | m_PrefabAsset: {fileID: 0} 97 | m_GameObject: {fileID: 7530022156930753192} 98 | m_Enabled: 1 99 | m_Color: 100 | serializedVersion: 2 101 | rgba: 4281282559 102 | m_Size: 1 103 | --- !u!114 &-937530412264702557 104 | MonoBehaviour: 105 | m_ObjectHideFlags: 0 106 | m_CorrespondingSourceObject: {fileID: 0} 107 | m_PrefabInstance: {fileID: 0} 108 | m_PrefabAsset: {fileID: 0} 109 | m_GameObject: {fileID: 7530022156930753192} 110 | m_Enabled: 1 111 | m_EditorHideFlags: 0 112 | m_Script: {fileID: 11500000, guid: 64bef8e5aef082e4fb2813f02d1368c5, type: 3} 113 | m_Name: 114 | m_EditorClassIdentifier: 115 | --- !u!114 &2380316914952706091 116 | MonoBehaviour: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | m_GameObject: {fileID: 7530022156930753192} 122 | m_Enabled: 1 123 | m_EditorHideFlags: 0 124 | m_Script: {fileID: 11500000, guid: f191ce631aab81249ad8b0564e585177, type: 3} 125 | m_Name: 126 | m_EditorClassIdentifier: 127 | --- !u!61 &8233190670634332126 128 | BoxCollider2D: 129 | m_ObjectHideFlags: 0 130 | m_CorrespondingSourceObject: {fileID: 0} 131 | m_PrefabInstance: {fileID: 0} 132 | m_PrefabAsset: {fileID: 0} 133 | m_GameObject: {fileID: 7530022156930753192} 134 | m_Enabled: 1 135 | m_Density: 1 136 | m_Material: {fileID: 0} 137 | m_IsTrigger: 0 138 | m_UsedByEffector: 0 139 | m_UsedByComposite: 0 140 | m_Offset: {x: 0, y: 0.04} 141 | m_SpriteTilingProperty: 142 | border: {x: 0, y: 0, z: 0, w: 0} 143 | pivot: {x: 0.5, y: 0} 144 | oldSize: {x: 0.08, y: 0.08} 145 | newSize: {x: 0.24, y: 0.2} 146 | adaptiveTilingThreshold: 0.5 147 | drawMode: 0 148 | adaptiveTiling: 0 149 | m_AutoTiling: 0 150 | serializedVersion: 2 151 | m_Size: {x: 0.08, y: 0.08} 152 | m_EdgeRadius: 0 153 | --- !u!50 &8314589716755157351 154 | Rigidbody2D: 155 | serializedVersion: 4 156 | m_ObjectHideFlags: 0 157 | m_CorrespondingSourceObject: {fileID: 0} 158 | m_PrefabInstance: {fileID: 0} 159 | m_PrefabAsset: {fileID: 0} 160 | m_GameObject: {fileID: 7530022156930753192} 161 | m_BodyType: 0 162 | m_Simulated: 1 163 | m_UseFullKinematicContacts: 0 164 | m_UseAutoMass: 0 165 | m_Mass: 1 166 | m_LinearDrag: 0 167 | m_AngularDrag: 0.05 168 | m_GravityScale: 1 169 | m_Material: {fileID: 0} 170 | m_Interpolate: 0 171 | m_SleepingMode: 1 172 | m_CollisionDetection: 0 173 | m_Constraints: 7 174 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/Sprites/AsteroidsArcade.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0796d67a60cabb34b96c213dcdb7156a 3 | TextureImporter: 4 | internalIDToNameTable: 5 | - first: 6 | 213: -3688360664190313356 7 | second: Ship1 8 | - first: 9 | 213: 7929229843044202141 10 | second: Bullet 11 | - first: 12 | 213: -5522339636744722164 13 | second: Laser 14 | - first: 15 | 213: -1631521915477014264 16 | second: Asteroid 17 | - first: 18 | 213: -8758211774284209605 19 | second: PartOfAsteroid 20 | - first: 21 | 213: 2977310587539912664 22 | second: Nlo 23 | externalObjects: {} 24 | serializedVersion: 11 25 | mipmaps: 26 | mipMapMode: 0 27 | enableMipMap: 0 28 | sRGBTexture: 1 29 | linearTexture: 0 30 | fadeOut: 0 31 | borderMipMap: 0 32 | mipMapsPreserveCoverage: 0 33 | alphaTestReferenceValue: 0.5 34 | mipMapFadeDistanceStart: 1 35 | mipMapFadeDistanceEnd: 3 36 | bumpmap: 37 | convertToNormalMap: 0 38 | externalNormalMap: 0 39 | heightScale: 0.25 40 | normalMapFilter: 0 41 | isReadable: 0 42 | streamingMipmaps: 0 43 | streamingMipmapsPriority: 0 44 | vTOnly: 0 45 | grayScaleToAlpha: 0 46 | generateCubemap: 6 47 | cubemapConvolution: 0 48 | seamlessCubemap: 0 49 | textureFormat: 1 50 | maxTextureSize: 2048 51 | textureSettings: 52 | serializedVersion: 2 53 | filterMode: 0 54 | aniso: 1 55 | mipBias: 0 56 | wrapU: 1 57 | wrapV: 1 58 | wrapW: 0 59 | nPOTScale: 0 60 | lightmap: 0 61 | compressionQuality: 50 62 | spriteMode: 2 63 | spriteExtrude: 1 64 | spriteMeshType: 1 65 | alignment: 0 66 | spritePivot: {x: 0.5, y: 0.5} 67 | spritePixelsToUnits: 25 68 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 69 | spriteGenerateFallbackPhysicsShape: 1 70 | alphaUsage: 1 71 | alphaIsTransparency: 1 72 | spriteTessellationDetail: -1 73 | textureType: 8 74 | textureShape: 1 75 | singleChannelComponent: 0 76 | flipbookRows: 1 77 | flipbookColumns: 1 78 | maxTextureSizeSet: 0 79 | compressionQualitySet: 0 80 | textureFormatSet: 0 81 | ignorePngGamma: 0 82 | applyGammaDecoding: 0 83 | platformSettings: 84 | - serializedVersion: 3 85 | buildTarget: DefaultTexturePlatform 86 | maxTextureSize: 2048 87 | resizeAlgorithm: 0 88 | textureFormat: -1 89 | textureCompression: 1 90 | compressionQuality: 50 91 | crunchedCompression: 0 92 | allowsAlphaSplitting: 0 93 | overridden: 0 94 | androidETC2FallbackOverride: 0 95 | forceMaximumCompressionQuality_BC6H_BC7: 0 96 | - serializedVersion: 3 97 | buildTarget: Standalone 98 | maxTextureSize: 2048 99 | resizeAlgorithm: 0 100 | textureFormat: -1 101 | textureCompression: 1 102 | compressionQuality: 50 103 | crunchedCompression: 0 104 | allowsAlphaSplitting: 0 105 | overridden: 0 106 | androidETC2FallbackOverride: 0 107 | forceMaximumCompressionQuality_BC6H_BC7: 0 108 | - serializedVersion: 3 109 | buildTarget: Android 110 | maxTextureSize: 2048 111 | resizeAlgorithm: 0 112 | textureFormat: -1 113 | textureCompression: 1 114 | compressionQuality: 50 115 | crunchedCompression: 0 116 | allowsAlphaSplitting: 0 117 | overridden: 0 118 | androidETC2FallbackOverride: 0 119 | forceMaximumCompressionQuality_BC6H_BC7: 0 120 | spriteSheet: 121 | serializedVersion: 2 122 | sprites: 123 | - serializedVersion: 2 124 | name: Ship1 125 | rect: 126 | serializedVersion: 2 127 | x: 40 128 | y: 195 129 | width: 16 130 | height: 28 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: 47c9967848f40dcc0800000000000000 139 | internalID: -3688360664190313356 140 | vertices: [] 141 | indices: 142 | edges: [] 143 | weights: [] 144 | - serializedVersion: 2 145 | name: Bullet 146 | rect: 147 | serializedVersion: 2 148 | x: 133 149 | y: 176 150 | width: 6 151 | height: 5 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: d96731908884a0e60800000000000000 160 | internalID: 7929229843044202141 161 | vertices: [] 162 | indices: 163 | edges: [] 164 | weights: [] 165 | - serializedVersion: 2 166 | name: Laser 167 | rect: 168 | serializedVersion: 2 169 | x: 225 170 | y: 95 171 | width: 2 172 | height: 2 173 | alignment: 9 174 | pivot: {x: 0.5, y: 0} 175 | border: {x: 0, y: 0, z: 0, w: 0} 176 | outline: [] 177 | physicsShape: [] 178 | tessellationDetail: 0 179 | bones: [] 180 | spriteID: c0965c6eb55bc53b0800000000000000 181 | internalID: -5522339636744722164 182 | vertices: [] 183 | indices: 184 | edges: [] 185 | weights: [] 186 | - serializedVersion: 2 187 | name: Asteroid 188 | rect: 189 | serializedVersion: 2 190 | x: 66 191 | y: 1 192 | width: 58 193 | height: 61 194 | alignment: 0 195 | pivot: {x: 0, y: 0} 196 | border: {x: 0, y: 0, z: 0, w: 0} 197 | outline: [] 198 | physicsShape: [] 199 | tessellationDetail: 0 200 | bones: [] 201 | spriteID: 8094ab8467bab59e0800000000000000 202 | internalID: -1631521915477014264 203 | vertices: [] 204 | indices: 205 | edges: [] 206 | weights: [] 207 | - serializedVersion: 2 208 | name: PartOfAsteroid 209 | rect: 210 | serializedVersion: 2 211 | x: 161 212 | y: 34 213 | width: 26 214 | height: 25 215 | alignment: 0 216 | pivot: {x: 0, y: 0} 217 | border: {x: 0, y: 0, z: 0, w: 0} 218 | outline: [] 219 | physicsShape: [] 220 | tessellationDetail: 0 221 | bones: [] 222 | spriteID: b3265265bc4947680800000000000000 223 | internalID: -8758211774284209605 224 | vertices: [] 225 | indices: 226 | edges: [] 227 | weights: [] 228 | - serializedVersion: 2 229 | name: Nlo 230 | rect: 231 | serializedVersion: 2 232 | x: 232 233 | y: 195 234 | width: 16 235 | height: 23 236 | alignment: 0 237 | pivot: {x: 0, y: 0} 238 | border: {x: 0, y: 0, z: 0, w: 0} 239 | outline: [] 240 | physicsShape: [] 241 | tessellationDetail: 0 242 | bones: [] 243 | spriteID: 8d773547438815920800000000000000 244 | internalID: 2977310587539912664 245 | vertices: [] 246 | indices: 247 | edges: [] 248 | weights: [] 249 | outline: [] 250 | physicsShape: [] 251 | bones: [] 252 | spriteID: e93f71c7205a35b43a09adbab94cee84 253 | internalID: 0 254 | vertices: [] 255 | indices: 256 | edges: [] 257 | weights: [] 258 | secondaryTextures: [] 259 | spritePackingTag: 260 | pSDRemoveMatte: 0 261 | pSDShowRemoveMatteOption: 0 262 | userData: 263 | assetBundleName: 264 | assetBundleVariant: 265 | -------------------------------------------------------------------------------- /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/Sources/Input/ShipInput.cs: -------------------------------------------------------------------------------- 1 | // GENERATED AUTOMATICALLY FROM 'Assets/Sources/Input/ShipInput.inputactions' 2 | 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using UnityEngine.InputSystem; 7 | using UnityEngine.InputSystem.Utilities; 8 | 9 | namespace Asteroids.Input 10 | { 11 | public class @ShipInput : IInputActionCollection, IDisposable 12 | { 13 | public InputActionAsset asset { get; } 14 | public @ShipInput() 15 | { 16 | asset = InputActionAsset.FromJson(@"{ 17 | ""name"": ""ShipInput"", 18 | ""maps"": [ 19 | { 20 | ""name"": ""Ship"", 21 | ""id"": ""057b7762-5199-4552-a4c1-0bc83990bfbc"", 22 | ""actions"": [ 23 | { 24 | ""name"": ""MoveForward"", 25 | ""type"": ""Button"", 26 | ""id"": ""a5734cbb-66d0-4b66-8a79-5fbc7f23696d"", 27 | ""expectedControlType"": ""Button"", 28 | ""processors"": """", 29 | ""interactions"": """" 30 | }, 31 | { 32 | ""name"": ""FirstSlotShoot"", 33 | ""type"": ""Button"", 34 | ""id"": ""db44999b-b1f5-43e2-8e24-479fee798b4e"", 35 | ""expectedControlType"": ""Button"", 36 | ""processors"": """", 37 | ""interactions"": """" 38 | }, 39 | { 40 | ""name"": ""SecondSlotShoot"", 41 | ""type"": ""Button"", 42 | ""id"": ""424ade2a-7918-4c84-8745-ab275bd4a60c"", 43 | ""expectedControlType"": ""Button"", 44 | ""processors"": """", 45 | ""interactions"": """" 46 | }, 47 | { 48 | ""name"": ""Rotate"", 49 | ""type"": ""Value"", 50 | ""id"": ""14f05330-31ac-4537-8288-d39dc249aeeb"", 51 | ""expectedControlType"": """", 52 | ""processors"": """", 53 | ""interactions"": """" 54 | } 55 | ], 56 | ""bindings"": [ 57 | { 58 | ""name"": """", 59 | ""id"": ""8fcf2221-66b5-47df-8b9d-f17d8a252368"", 60 | ""path"": ""/w"", 61 | ""interactions"": ""Hold(duration=0.001,pressPoint=0.001)"", 62 | ""processors"": """", 63 | ""groups"": """", 64 | ""action"": ""MoveForward"", 65 | ""isComposite"": false, 66 | ""isPartOfComposite"": false 67 | }, 68 | { 69 | ""name"": """", 70 | ""id"": ""aa03d3d8-7663-4d47-8972-43fdb4f324ac"", 71 | ""path"": ""/q"", 72 | ""interactions"": """", 73 | ""processors"": """", 74 | ""groups"": """", 75 | ""action"": ""FirstSlotShoot"", 76 | ""isComposite"": false, 77 | ""isPartOfComposite"": false 78 | }, 79 | { 80 | ""name"": """", 81 | ""id"": ""d1d9e4db-49df-4050-8c52-775be950a253"", 82 | ""path"": ""/e"", 83 | ""interactions"": """", 84 | ""processors"": """", 85 | ""groups"": """", 86 | ""action"": ""SecondSlotShoot"", 87 | ""isComposite"": false, 88 | ""isPartOfComposite"": false 89 | }, 90 | { 91 | ""name"": ""Direction"", 92 | ""id"": ""ca7ac779-c41f-42ad-aeda-565f48879850"", 93 | ""path"": ""1DAxis"", 94 | ""interactions"": """", 95 | ""processors"": ""Invert"", 96 | ""groups"": """", 97 | ""action"": ""Rotate"", 98 | ""isComposite"": true, 99 | ""isPartOfComposite"": false 100 | }, 101 | { 102 | ""name"": ""negative"", 103 | ""id"": ""02f47a46-655b-45f2-9d92-f28adde1e988"", 104 | ""path"": ""/a"", 105 | ""interactions"": """", 106 | ""processors"": """", 107 | ""groups"": """", 108 | ""action"": ""Rotate"", 109 | ""isComposite"": false, 110 | ""isPartOfComposite"": true 111 | }, 112 | { 113 | ""name"": ""positive"", 114 | ""id"": ""64ecaf39-7d68-4106-80b7-0df12a9cda4c"", 115 | ""path"": ""/d"", 116 | ""interactions"": """", 117 | ""processors"": """", 118 | ""groups"": """", 119 | ""action"": ""Rotate"", 120 | ""isComposite"": false, 121 | ""isPartOfComposite"": true 122 | } 123 | ] 124 | } 125 | ], 126 | ""controlSchemes"": [] 127 | }"); 128 | // Ship 129 | m_Ship = asset.FindActionMap("Ship", throwIfNotFound: true); 130 | m_Ship_MoveForward = m_Ship.FindAction("MoveForward", throwIfNotFound: true); 131 | m_Ship_FirstSlotShoot = m_Ship.FindAction("FirstSlotShoot", throwIfNotFound: true); 132 | m_Ship_SecondSlotShoot = m_Ship.FindAction("SecondSlotShoot", throwIfNotFound: true); 133 | m_Ship_Rotate = m_Ship.FindAction("Rotate", throwIfNotFound: true); 134 | } 135 | 136 | public void Dispose() 137 | { 138 | UnityEngine.Object.Destroy(asset); 139 | } 140 | 141 | public InputBinding? bindingMask 142 | { 143 | get => asset.bindingMask; 144 | set => asset.bindingMask = value; 145 | } 146 | 147 | public ReadOnlyArray? devices 148 | { 149 | get => asset.devices; 150 | set => asset.devices = value; 151 | } 152 | 153 | public ReadOnlyArray controlSchemes => asset.controlSchemes; 154 | 155 | public bool Contains(InputAction action) 156 | { 157 | return asset.Contains(action); 158 | } 159 | 160 | public IEnumerator GetEnumerator() 161 | { 162 | return asset.GetEnumerator(); 163 | } 164 | 165 | IEnumerator IEnumerable.GetEnumerator() 166 | { 167 | return GetEnumerator(); 168 | } 169 | 170 | public void Enable() 171 | { 172 | asset.Enable(); 173 | } 174 | 175 | public void Disable() 176 | { 177 | asset.Disable(); 178 | } 179 | 180 | // Ship 181 | private readonly InputActionMap m_Ship; 182 | private IShipActions m_ShipActionsCallbackInterface; 183 | private readonly InputAction m_Ship_MoveForward; 184 | private readonly InputAction m_Ship_FirstSlotShoot; 185 | private readonly InputAction m_Ship_SecondSlotShoot; 186 | private readonly InputAction m_Ship_Rotate; 187 | public struct ShipActions 188 | { 189 | private @ShipInput m_Wrapper; 190 | public ShipActions(@ShipInput wrapper) { m_Wrapper = wrapper; } 191 | public InputAction @MoveForward => m_Wrapper.m_Ship_MoveForward; 192 | public InputAction @FirstSlotShoot => m_Wrapper.m_Ship_FirstSlotShoot; 193 | public InputAction @SecondSlotShoot => m_Wrapper.m_Ship_SecondSlotShoot; 194 | public InputAction @Rotate => m_Wrapper.m_Ship_Rotate; 195 | public InputActionMap Get() { return m_Wrapper.m_Ship; } 196 | public void Enable() { Get().Enable(); } 197 | public void Disable() { Get().Disable(); } 198 | public bool enabled => Get().enabled; 199 | public static implicit operator InputActionMap(ShipActions set) { return set.Get(); } 200 | public void SetCallbacks(IShipActions instance) 201 | { 202 | if (m_Wrapper.m_ShipActionsCallbackInterface != null) 203 | { 204 | @MoveForward.started -= m_Wrapper.m_ShipActionsCallbackInterface.OnMoveForward; 205 | @MoveForward.performed -= m_Wrapper.m_ShipActionsCallbackInterface.OnMoveForward; 206 | @MoveForward.canceled -= m_Wrapper.m_ShipActionsCallbackInterface.OnMoveForward; 207 | @FirstSlotShoot.started -= m_Wrapper.m_ShipActionsCallbackInterface.OnFirstSlotShoot; 208 | @FirstSlotShoot.performed -= m_Wrapper.m_ShipActionsCallbackInterface.OnFirstSlotShoot; 209 | @FirstSlotShoot.canceled -= m_Wrapper.m_ShipActionsCallbackInterface.OnFirstSlotShoot; 210 | @SecondSlotShoot.started -= m_Wrapper.m_ShipActionsCallbackInterface.OnSecondSlotShoot; 211 | @SecondSlotShoot.performed -= m_Wrapper.m_ShipActionsCallbackInterface.OnSecondSlotShoot; 212 | @SecondSlotShoot.canceled -= m_Wrapper.m_ShipActionsCallbackInterface.OnSecondSlotShoot; 213 | @Rotate.started -= m_Wrapper.m_ShipActionsCallbackInterface.OnRotate; 214 | @Rotate.performed -= m_Wrapper.m_ShipActionsCallbackInterface.OnRotate; 215 | @Rotate.canceled -= m_Wrapper.m_ShipActionsCallbackInterface.OnRotate; 216 | } 217 | m_Wrapper.m_ShipActionsCallbackInterface = instance; 218 | if (instance != null) 219 | { 220 | @MoveForward.started += instance.OnMoveForward; 221 | @MoveForward.performed += instance.OnMoveForward; 222 | @MoveForward.canceled += instance.OnMoveForward; 223 | @FirstSlotShoot.started += instance.OnFirstSlotShoot; 224 | @FirstSlotShoot.performed += instance.OnFirstSlotShoot; 225 | @FirstSlotShoot.canceled += instance.OnFirstSlotShoot; 226 | @SecondSlotShoot.started += instance.OnSecondSlotShoot; 227 | @SecondSlotShoot.performed += instance.OnSecondSlotShoot; 228 | @SecondSlotShoot.canceled += instance.OnSecondSlotShoot; 229 | @Rotate.started += instance.OnRotate; 230 | @Rotate.performed += instance.OnRotate; 231 | @Rotate.canceled += instance.OnRotate; 232 | } 233 | } 234 | } 235 | public ShipActions @Ship => new ShipActions(this); 236 | public interface IShipActions 237 | { 238 | void OnMoveForward(InputAction.CallbackContext context); 239 | void OnFirstSlotShoot(InputAction.CallbackContext context); 240 | void OnSecondSlotShoot(InputAction.CallbackContext context); 241 | void OnRotate(InputAction.CallbackContext context); 242 | } 243 | } 244 | } 245 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.sprite": { 4 | "version": "1.0.0", 5 | "depth": 0, 6 | "source": "builtin", 7 | "dependencies": {} 8 | }, 9 | "com.unity.collab-proxy": { 10 | "version": "1.7.1", 11 | "depth": 0, 12 | "source": "registry", 13 | "dependencies": { 14 | "com.unity.nuget.newtonsoft-json": "2.0.0" 15 | }, 16 | "url": "https://packages.unity.com" 17 | }, 18 | "com.unity.ext.nunit": { 19 | "version": "1.0.6", 20 | "depth": 1, 21 | "source": "registry", 22 | "dependencies": {}, 23 | "url": "https://packages.unity.com" 24 | }, 25 | "com.unity.ide.rider": { 26 | "version": "3.0.7", 27 | "depth": 0, 28 | "source": "registry", 29 | "dependencies": { 30 | "com.unity.ext.nunit": "1.0.6" 31 | }, 32 | "url": "https://packages.unity.com" 33 | }, 34 | "com.unity.ide.visualstudio": { 35 | "version": "2.0.11", 36 | "depth": 0, 37 | "source": "registry", 38 | "dependencies": { 39 | "com.unity.test-framework": "1.1.9" 40 | }, 41 | "url": "https://packages.unity.com" 42 | }, 43 | "com.unity.ide.vscode": { 44 | "version": "1.2.3", 45 | "depth": 0, 46 | "source": "registry", 47 | "dependencies": {}, 48 | "url": "https://packages.unity.com" 49 | }, 50 | "com.unity.inputsystem": { 51 | "version": "1.0.2", 52 | "depth": 0, 53 | "source": "registry", 54 | "dependencies": {}, 55 | "url": "https://packages.unity.com" 56 | }, 57 | "com.unity.nuget.newtonsoft-json": { 58 | "version": "2.0.0", 59 | "depth": 1, 60 | "source": "registry", 61 | "dependencies": {}, 62 | "url": "https://packages.unity.com" 63 | }, 64 | "com.unity.test-framework": { 65 | "version": "1.1.27", 66 | "depth": 0, 67 | "source": "registry", 68 | "dependencies": { 69 | "com.unity.ext.nunit": "1.0.6", 70 | "com.unity.modules.imgui": "1.0.0", 71 | "com.unity.modules.jsonserialize": "1.0.0" 72 | }, 73 | "url": "https://packages.unity.com" 74 | }, 75 | "com.unity.textmeshpro": { 76 | "version": "3.0.6", 77 | "depth": 0, 78 | "source": "registry", 79 | "dependencies": { 80 | "com.unity.ugui": "1.0.0" 81 | }, 82 | "url": "https://packages.unity.com" 83 | }, 84 | "com.unity.timeline": { 85 | "version": "1.5.6", 86 | "depth": 0, 87 | "source": "registry", 88 | "dependencies": { 89 | "com.unity.modules.director": "1.0.0", 90 | "com.unity.modules.animation": "1.0.0", 91 | "com.unity.modules.audio": "1.0.0", 92 | "com.unity.modules.particlesystem": "1.0.0" 93 | }, 94 | "url": "https://packages.unity.com" 95 | }, 96 | "com.unity.ugui": { 97 | "version": "1.0.0", 98 | "depth": 0, 99 | "source": "builtin", 100 | "dependencies": { 101 | "com.unity.modules.ui": "1.0.0", 102 | "com.unity.modules.imgui": "1.0.0" 103 | } 104 | }, 105 | "com.unity.visualscripting": { 106 | "version": "1.6.1", 107 | "depth": 0, 108 | "source": "registry", 109 | "dependencies": { 110 | "com.unity.ugui": "1.0.0", 111 | "com.unity.modules.ai": "1.0.0", 112 | "com.unity.modules.animation": "1.0.0", 113 | "com.unity.modules.jsonserialize": "1.0.0", 114 | "com.unity.modules.particlesystem": "1.0.0", 115 | "com.unity.modules.physics": "1.0.0", 116 | "com.unity.modules.physics2d": "1.0.0" 117 | }, 118 | "url": "https://packages.unity.com" 119 | }, 120 | "com.unity.modules.ai": { 121 | "version": "1.0.0", 122 | "depth": 0, 123 | "source": "builtin", 124 | "dependencies": {} 125 | }, 126 | "com.unity.modules.androidjni": { 127 | "version": "1.0.0", 128 | "depth": 0, 129 | "source": "builtin", 130 | "dependencies": {} 131 | }, 132 | "com.unity.modules.animation": { 133 | "version": "1.0.0", 134 | "depth": 0, 135 | "source": "builtin", 136 | "dependencies": {} 137 | }, 138 | "com.unity.modules.assetbundle": { 139 | "version": "1.0.0", 140 | "depth": 0, 141 | "source": "builtin", 142 | "dependencies": {} 143 | }, 144 | "com.unity.modules.audio": { 145 | "version": "1.0.0", 146 | "depth": 0, 147 | "source": "builtin", 148 | "dependencies": {} 149 | }, 150 | "com.unity.modules.cloth": { 151 | "version": "1.0.0", 152 | "depth": 0, 153 | "source": "builtin", 154 | "dependencies": { 155 | "com.unity.modules.physics": "1.0.0" 156 | } 157 | }, 158 | "com.unity.modules.director": { 159 | "version": "1.0.0", 160 | "depth": 0, 161 | "source": "builtin", 162 | "dependencies": { 163 | "com.unity.modules.audio": "1.0.0", 164 | "com.unity.modules.animation": "1.0.0" 165 | } 166 | }, 167 | "com.unity.modules.imageconversion": { 168 | "version": "1.0.0", 169 | "depth": 0, 170 | "source": "builtin", 171 | "dependencies": {} 172 | }, 173 | "com.unity.modules.imgui": { 174 | "version": "1.0.0", 175 | "depth": 0, 176 | "source": "builtin", 177 | "dependencies": {} 178 | }, 179 | "com.unity.modules.jsonserialize": { 180 | "version": "1.0.0", 181 | "depth": 0, 182 | "source": "builtin", 183 | "dependencies": {} 184 | }, 185 | "com.unity.modules.particlesystem": { 186 | "version": "1.0.0", 187 | "depth": 0, 188 | "source": "builtin", 189 | "dependencies": {} 190 | }, 191 | "com.unity.modules.physics": { 192 | "version": "1.0.0", 193 | "depth": 0, 194 | "source": "builtin", 195 | "dependencies": {} 196 | }, 197 | "com.unity.modules.physics2d": { 198 | "version": "1.0.0", 199 | "depth": 0, 200 | "source": "builtin", 201 | "dependencies": {} 202 | }, 203 | "com.unity.modules.screencapture": { 204 | "version": "1.0.0", 205 | "depth": 0, 206 | "source": "builtin", 207 | "dependencies": { 208 | "com.unity.modules.imageconversion": "1.0.0" 209 | } 210 | }, 211 | "com.unity.modules.subsystems": { 212 | "version": "1.0.0", 213 | "depth": 1, 214 | "source": "builtin", 215 | "dependencies": { 216 | "com.unity.modules.jsonserialize": "1.0.0" 217 | } 218 | }, 219 | "com.unity.modules.terrain": { 220 | "version": "1.0.0", 221 | "depth": 0, 222 | "source": "builtin", 223 | "dependencies": {} 224 | }, 225 | "com.unity.modules.terrainphysics": { 226 | "version": "1.0.0", 227 | "depth": 0, 228 | "source": "builtin", 229 | "dependencies": { 230 | "com.unity.modules.physics": "1.0.0", 231 | "com.unity.modules.terrain": "1.0.0" 232 | } 233 | }, 234 | "com.unity.modules.tilemap": { 235 | "version": "1.0.0", 236 | "depth": 0, 237 | "source": "builtin", 238 | "dependencies": { 239 | "com.unity.modules.physics2d": "1.0.0" 240 | } 241 | }, 242 | "com.unity.modules.ui": { 243 | "version": "1.0.0", 244 | "depth": 0, 245 | "source": "builtin", 246 | "dependencies": {} 247 | }, 248 | "com.unity.modules.uielements": { 249 | "version": "1.0.0", 250 | "depth": 0, 251 | "source": "builtin", 252 | "dependencies": { 253 | "com.unity.modules.ui": "1.0.0", 254 | "com.unity.modules.imgui": "1.0.0", 255 | "com.unity.modules.jsonserialize": "1.0.0", 256 | "com.unity.modules.uielementsnative": "1.0.0" 257 | } 258 | }, 259 | "com.unity.modules.uielementsnative": { 260 | "version": "1.0.0", 261 | "depth": 1, 262 | "source": "builtin", 263 | "dependencies": { 264 | "com.unity.modules.ui": "1.0.0", 265 | "com.unity.modules.imgui": "1.0.0", 266 | "com.unity.modules.jsonserialize": "1.0.0" 267 | } 268 | }, 269 | "com.unity.modules.umbra": { 270 | "version": "1.0.0", 271 | "depth": 0, 272 | "source": "builtin", 273 | "dependencies": {} 274 | }, 275 | "com.unity.modules.unityanalytics": { 276 | "version": "1.0.0", 277 | "depth": 0, 278 | "source": "builtin", 279 | "dependencies": { 280 | "com.unity.modules.unitywebrequest": "1.0.0", 281 | "com.unity.modules.jsonserialize": "1.0.0" 282 | } 283 | }, 284 | "com.unity.modules.unitywebrequest": { 285 | "version": "1.0.0", 286 | "depth": 0, 287 | "source": "builtin", 288 | "dependencies": {} 289 | }, 290 | "com.unity.modules.unitywebrequestassetbundle": { 291 | "version": "1.0.0", 292 | "depth": 0, 293 | "source": "builtin", 294 | "dependencies": { 295 | "com.unity.modules.assetbundle": "1.0.0", 296 | "com.unity.modules.unitywebrequest": "1.0.0" 297 | } 298 | }, 299 | "com.unity.modules.unitywebrequestaudio": { 300 | "version": "1.0.0", 301 | "depth": 0, 302 | "source": "builtin", 303 | "dependencies": { 304 | "com.unity.modules.unitywebrequest": "1.0.0", 305 | "com.unity.modules.audio": "1.0.0" 306 | } 307 | }, 308 | "com.unity.modules.unitywebrequesttexture": { 309 | "version": "1.0.0", 310 | "depth": 0, 311 | "source": "builtin", 312 | "dependencies": { 313 | "com.unity.modules.unitywebrequest": "1.0.0", 314 | "com.unity.modules.imageconversion": "1.0.0" 315 | } 316 | }, 317 | "com.unity.modules.unitywebrequestwww": { 318 | "version": "1.0.0", 319 | "depth": 0, 320 | "source": "builtin", 321 | "dependencies": { 322 | "com.unity.modules.unitywebrequest": "1.0.0", 323 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 324 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 325 | "com.unity.modules.audio": "1.0.0", 326 | "com.unity.modules.assetbundle": "1.0.0", 327 | "com.unity.modules.imageconversion": "1.0.0" 328 | } 329 | }, 330 | "com.unity.modules.vehicles": { 331 | "version": "1.0.0", 332 | "depth": 0, 333 | "source": "builtin", 334 | "dependencies": { 335 | "com.unity.modules.physics": "1.0.0" 336 | } 337 | }, 338 | "com.unity.modules.video": { 339 | "version": "1.0.0", 340 | "depth": 0, 341 | "source": "builtin", 342 | "dependencies": { 343 | "com.unity.modules.audio": "1.0.0", 344 | "com.unity.modules.ui": "1.0.0", 345 | "com.unity.modules.unitywebrequest": "1.0.0" 346 | } 347 | }, 348 | "com.unity.modules.vr": { 349 | "version": "1.0.0", 350 | "depth": 0, 351 | "source": "builtin", 352 | "dependencies": { 353 | "com.unity.modules.jsonserialize": "1.0.0", 354 | "com.unity.modules.physics": "1.0.0", 355 | "com.unity.modules.xr": "1.0.0" 356 | } 357 | }, 358 | "com.unity.modules.wind": { 359 | "version": "1.0.0", 360 | "depth": 0, 361 | "source": "builtin", 362 | "dependencies": {} 363 | }, 364 | "com.unity.modules.xr": { 365 | "version": "1.0.0", 366 | "depth": 0, 367 | "source": "builtin", 368 | "dependencies": { 369 | "com.unity.modules.physics": "1.0.0", 370 | "com.unity.modules.jsonserialize": "1.0.0", 371 | "com.unity.modules.subsystems": "1.0.0" 372 | } 373 | } 374 | } 375 | } 376 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 22 7 | productGUID: 5b34efee4b08d7444a7b41190209b34c 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: Asteroids 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | mipStripping: 0 53 | numberOfMipsStripped: 0 54 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 55 | iosShowActivityIndicatorOnLoading: -1 56 | androidShowActivityIndicatorOnLoading: -1 57 | iosUseCustomAppBackgroundBehavior: 0 58 | iosAllowHTTPDownload: 1 59 | allowedAutorotateToPortrait: 1 60 | allowedAutorotateToPortraitUpsideDown: 1 61 | allowedAutorotateToLandscapeRight: 1 62 | allowedAutorotateToLandscapeLeft: 1 63 | useOSAutorotation: 1 64 | use32BitDisplayBuffer: 1 65 | preserveFramebufferAlpha: 0 66 | disableDepthAndStencilBuffers: 0 67 | androidStartInFullscreen: 1 68 | androidRenderOutsideSafeArea: 1 69 | androidUseSwappy: 1 70 | androidBlitType: 0 71 | androidResizableWindow: 0 72 | androidDefaultWindowWidth: 1920 73 | androidDefaultWindowHeight: 1080 74 | androidMinimumWindowWidth: 400 75 | androidMinimumWindowHeight: 300 76 | androidFullscreenMode: 1 77 | defaultIsNativeResolution: 1 78 | macRetinaSupport: 1 79 | runInBackground: 1 80 | captureSingleScreen: 0 81 | muteOtherAudioSources: 0 82 | Prepare IOS For Recording: 0 83 | Force IOS Speakers When Recording: 0 84 | deferSystemGesturesMode: 0 85 | hideHomeButton: 0 86 | submitAnalytics: 1 87 | usePlayerLog: 1 88 | bakeCollisionMeshes: 0 89 | forceSingleInstance: 0 90 | useFlipModelSwapchain: 1 91 | resizableWindow: 0 92 | useMacAppStoreValidation: 0 93 | macAppStoreCategory: public.app-category.games 94 | gpuSkinning: 1 95 | xboxPIXTextureCapture: 0 96 | xboxEnableAvatar: 0 97 | xboxEnableKinect: 0 98 | xboxEnableKinectAutoTracking: 0 99 | xboxEnableFitness: 0 100 | visibleInBackground: 1 101 | allowFullscreenSwitch: 1 102 | fullscreenMode: 1 103 | xboxSpeechDB: 0 104 | xboxEnableHeadOrientation: 0 105 | xboxEnableGuest: 0 106 | xboxEnablePIXSampling: 0 107 | metalFramebufferOnly: 0 108 | xboxOneResolution: 0 109 | xboxOneSResolution: 0 110 | xboxOneXResolution: 3 111 | xboxOneMonoLoggingLevel: 0 112 | xboxOneLoggingLevel: 1 113 | xboxOneDisableEsram: 0 114 | xboxOneEnableTypeOptimization: 0 115 | xboxOnePresentImmediateThreshold: 0 116 | switchQueueCommandMemory: 0 117 | switchQueueControlMemory: 16384 118 | switchQueueComputeMemory: 262144 119 | switchNVNShaderPoolsGranularity: 33554432 120 | switchNVNDefaultPoolsGranularity: 16777216 121 | switchNVNOtherPoolsGranularity: 16777216 122 | switchNVNMaxPublicTextureIDCount: 0 123 | switchNVNMaxPublicSamplerIDCount: 0 124 | stadiaPresentMode: 0 125 | stadiaTargetFramerate: 0 126 | vulkanNumSwapchainBuffers: 3 127 | vulkanEnableSetSRGBWrite: 0 128 | vulkanEnablePreTransform: 0 129 | vulkanEnableLateAcquireNextImage: 0 130 | vulkanEnableCommandBufferRecycling: 1 131 | m_SupportedAspectRatios: 132 | 4:3: 1 133 | 5:4: 1 134 | 16:10: 1 135 | 16:9: 1 136 | Others: 1 137 | bundleVersion: 0.1 138 | preloadedAssets: [] 139 | metroInputSource: 0 140 | wsaTransparentSwapchain: 0 141 | m_HolographicPauseOnTrackingLoss: 1 142 | xboxOneDisableKinectGpuReservation: 1 143 | xboxOneEnable7thCore: 1 144 | vrSettings: 145 | enable360StereoCapture: 0 146 | isWsaHolographicRemotingEnabled: 0 147 | enableFrameTimingStats: 0 148 | useHDRDisplay: 0 149 | D3DHDRBitDepth: 0 150 | m_ColorGamuts: 00000000 151 | targetPixelDensity: 30 152 | resolutionScalingMode: 0 153 | androidSupportedAspectRatio: 1 154 | androidMaxAspectRatio: 2.1 155 | applicationIdentifier: 156 | Android: com.DefaultCompany.Asteroids 157 | Standalone: com.DefaultCompany.Asteroids 158 | buildNumber: 159 | Standalone: 0 160 | iPhone: 0 161 | tvOS: 0 162 | overrideDefaultApplicationIdentifier: 0 163 | AndroidBundleVersionCode: 1 164 | AndroidMinSdkVersion: 19 165 | AndroidTargetSdkVersion: 0 166 | AndroidPreferredInstallLocation: 1 167 | aotOptions: 168 | stripEngineCode: 1 169 | iPhoneStrippingLevel: 0 170 | iPhoneScriptCallOptimization: 0 171 | ForceInternetPermission: 0 172 | ForceSDCardPermission: 0 173 | CreateWallpaper: 0 174 | APKExpansionFiles: 0 175 | keepLoadedShadersAlive: 0 176 | StripUnusedMeshComponents: 1 177 | VertexChannelCompressionMask: 4054 178 | iPhoneSdkVersion: 988 179 | iOSTargetOSVersionString: 11.0 180 | tvOSSdkVersion: 0 181 | tvOSRequireExtendedGameController: 0 182 | tvOSTargetOSVersionString: 11.0 183 | uIPrerenderedIcon: 0 184 | uIRequiresPersistentWiFi: 0 185 | uIRequiresFullScreen: 1 186 | uIStatusBarHidden: 1 187 | uIExitOnSuspend: 0 188 | uIStatusBarStyle: 0 189 | appleTVSplashScreen: {fileID: 0} 190 | appleTVSplashScreen2x: {fileID: 0} 191 | tvOSSmallIconLayers: [] 192 | tvOSSmallIconLayers2x: [] 193 | tvOSLargeIconLayers: [] 194 | tvOSLargeIconLayers2x: [] 195 | tvOSTopShelfImageLayers: [] 196 | tvOSTopShelfImageLayers2x: [] 197 | tvOSTopShelfImageWideLayers: [] 198 | tvOSTopShelfImageWideLayers2x: [] 199 | iOSLaunchScreenType: 0 200 | iOSLaunchScreenPortrait: {fileID: 0} 201 | iOSLaunchScreenLandscape: {fileID: 0} 202 | iOSLaunchScreenBackgroundColor: 203 | serializedVersion: 2 204 | rgba: 0 205 | iOSLaunchScreenFillPct: 100 206 | iOSLaunchScreenSize: 100 207 | iOSLaunchScreenCustomXibPath: 208 | iOSLaunchScreeniPadType: 0 209 | iOSLaunchScreeniPadImage: {fileID: 0} 210 | iOSLaunchScreeniPadBackgroundColor: 211 | serializedVersion: 2 212 | rgba: 0 213 | iOSLaunchScreeniPadFillPct: 100 214 | iOSLaunchScreeniPadSize: 100 215 | iOSLaunchScreeniPadCustomXibPath: 216 | iOSLaunchScreenCustomStoryboardPath: 217 | iOSLaunchScreeniPadCustomStoryboardPath: 218 | iOSDeviceRequirements: [] 219 | iOSURLSchemes: [] 220 | iOSBackgroundModes: 0 221 | iOSMetalForceHardShadows: 0 222 | metalEditorSupport: 1 223 | metalAPIValidation: 1 224 | iOSRenderExtraFrameOnPause: 0 225 | iosCopyPluginsCodeInsteadOfSymlink: 0 226 | appleDeveloperTeamID: 227 | iOSManualSigningProvisioningProfileID: 228 | tvOSManualSigningProvisioningProfileID: 229 | iOSManualSigningProvisioningProfileType: 0 230 | tvOSManualSigningProvisioningProfileType: 0 231 | appleEnableAutomaticSigning: 0 232 | iOSRequireARKit: 0 233 | iOSAutomaticallyDetectAndAddCapabilities: 1 234 | appleEnableProMotion: 0 235 | shaderPrecisionModel: 0 236 | clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea 237 | templatePackageId: com.unity.template.3d@5.0.4 238 | templateDefaultScene: Assets/Scenes/SampleScene.unity 239 | useCustomMainManifest: 0 240 | useCustomLauncherManifest: 0 241 | useCustomMainGradleTemplate: 0 242 | useCustomLauncherGradleManifest: 0 243 | useCustomBaseGradleTemplate: 0 244 | useCustomGradlePropertiesTemplate: 0 245 | useCustomProguardFile: 0 246 | AndroidTargetArchitectures: 1 247 | AndroidTargetDevices: 0 248 | AndroidSplashScreenScale: 0 249 | androidSplashScreen: {fileID: 0} 250 | AndroidKeystoreName: 251 | AndroidKeyaliasName: 252 | AndroidBuildApkPerCpuArchitecture: 0 253 | AndroidTVCompatibility: 0 254 | AndroidIsGame: 1 255 | AndroidEnableTango: 0 256 | androidEnableBanner: 1 257 | androidUseLowAccuracyLocation: 0 258 | androidUseCustomKeystore: 0 259 | m_AndroidBanners: 260 | - width: 320 261 | height: 180 262 | banner: {fileID: 0} 263 | androidGamepadSupportLevel: 0 264 | chromeosInputEmulation: 1 265 | AndroidMinifyWithR8: 0 266 | AndroidMinifyRelease: 0 267 | AndroidMinifyDebug: 0 268 | AndroidValidateAppBundleSize: 1 269 | AndroidAppBundleSizeToValidate: 150 270 | m_BuildTargetIcons: [] 271 | m_BuildTargetPlatformIcons: [] 272 | m_BuildTargetBatching: 273 | - m_BuildTarget: Standalone 274 | m_StaticBatching: 1 275 | m_DynamicBatching: 0 276 | - m_BuildTarget: tvOS 277 | m_StaticBatching: 1 278 | m_DynamicBatching: 0 279 | - m_BuildTarget: Android 280 | m_StaticBatching: 1 281 | m_DynamicBatching: 0 282 | - m_BuildTarget: iPhone 283 | m_StaticBatching: 1 284 | m_DynamicBatching: 0 285 | - m_BuildTarget: WebGL 286 | m_StaticBatching: 0 287 | m_DynamicBatching: 0 288 | m_BuildTargetGraphicsJobs: 289 | - m_BuildTarget: MacStandaloneSupport 290 | m_GraphicsJobs: 0 291 | - m_BuildTarget: Switch 292 | m_GraphicsJobs: 1 293 | - m_BuildTarget: MetroSupport 294 | m_GraphicsJobs: 1 295 | - m_BuildTarget: AppleTVSupport 296 | m_GraphicsJobs: 0 297 | - m_BuildTarget: BJMSupport 298 | m_GraphicsJobs: 1 299 | - m_BuildTarget: LinuxStandaloneSupport 300 | m_GraphicsJobs: 1 301 | - m_BuildTarget: PS4Player 302 | m_GraphicsJobs: 1 303 | - m_BuildTarget: iOSSupport 304 | m_GraphicsJobs: 0 305 | - m_BuildTarget: WindowsStandaloneSupport 306 | m_GraphicsJobs: 1 307 | - m_BuildTarget: XboxOnePlayer 308 | m_GraphicsJobs: 1 309 | - m_BuildTarget: LuminSupport 310 | m_GraphicsJobs: 0 311 | - m_BuildTarget: AndroidPlayer 312 | m_GraphicsJobs: 0 313 | - m_BuildTarget: WebGLSupport 314 | m_GraphicsJobs: 0 315 | m_BuildTargetGraphicsJobMode: 316 | - m_BuildTarget: PS4Player 317 | m_GraphicsJobMode: 0 318 | - m_BuildTarget: XboxOnePlayer 319 | m_GraphicsJobMode: 0 320 | m_BuildTargetGraphicsAPIs: 321 | - m_BuildTarget: AndroidPlayer 322 | m_APIs: 150000000b000000 323 | m_Automatic: 0 324 | - m_BuildTarget: iOSSupport 325 | m_APIs: 10000000 326 | m_Automatic: 1 327 | - m_BuildTarget: AppleTVSupport 328 | m_APIs: 10000000 329 | m_Automatic: 1 330 | - m_BuildTarget: WebGLSupport 331 | m_APIs: 0b000000 332 | m_Automatic: 1 333 | m_BuildTargetVRSettings: 334 | - m_BuildTarget: Standalone 335 | m_Enabled: 0 336 | m_Devices: 337 | - Oculus 338 | - OpenVR 339 | openGLRequireES31: 0 340 | openGLRequireES31AEP: 0 341 | openGLRequireES32: 0 342 | m_TemplateCustomTags: {} 343 | mobileMTRendering: 344 | Android: 1 345 | iPhone: 1 346 | tvOS: 1 347 | m_BuildTargetGroupLightmapEncodingQuality: [] 348 | m_BuildTargetGroupLightmapSettings: [] 349 | m_BuildTargetNormalMapEncoding: [] 350 | playModeTestRunnerEnabled: 0 351 | runPlayModeTestAsEditModeTest: 0 352 | actionOnDotNetUnhandledException: 1 353 | enableInternalProfiler: 0 354 | logObjCUncaughtExceptions: 1 355 | enableCrashReportAPI: 0 356 | cameraUsageDescription: 357 | locationUsageDescription: 358 | microphoneUsageDescription: 359 | bluetoothUsageDescription: 360 | switchNMETAOverride: 361 | switchNetLibKey: 362 | switchSocketMemoryPoolSize: 6144 363 | switchSocketAllocatorPoolSize: 128 364 | switchSocketConcurrencyLimit: 14 365 | switchScreenResolutionBehavior: 2 366 | switchUseCPUProfiler: 0 367 | switchUseGOLDLinker: 0 368 | switchLTOSetting: 0 369 | switchApplicationID: 0x01004b9000490000 370 | switchNSODependencies: 371 | switchTitleNames_0: 372 | switchTitleNames_1: 373 | switchTitleNames_2: 374 | switchTitleNames_3: 375 | switchTitleNames_4: 376 | switchTitleNames_5: 377 | switchTitleNames_6: 378 | switchTitleNames_7: 379 | switchTitleNames_8: 380 | switchTitleNames_9: 381 | switchTitleNames_10: 382 | switchTitleNames_11: 383 | switchTitleNames_12: 384 | switchTitleNames_13: 385 | switchTitleNames_14: 386 | switchTitleNames_15: 387 | switchPublisherNames_0: 388 | switchPublisherNames_1: 389 | switchPublisherNames_2: 390 | switchPublisherNames_3: 391 | switchPublisherNames_4: 392 | switchPublisherNames_5: 393 | switchPublisherNames_6: 394 | switchPublisherNames_7: 395 | switchPublisherNames_8: 396 | switchPublisherNames_9: 397 | switchPublisherNames_10: 398 | switchPublisherNames_11: 399 | switchPublisherNames_12: 400 | switchPublisherNames_13: 401 | switchPublisherNames_14: 402 | switchPublisherNames_15: 403 | switchIcons_0: {fileID: 0} 404 | switchIcons_1: {fileID: 0} 405 | switchIcons_2: {fileID: 0} 406 | switchIcons_3: {fileID: 0} 407 | switchIcons_4: {fileID: 0} 408 | switchIcons_5: {fileID: 0} 409 | switchIcons_6: {fileID: 0} 410 | switchIcons_7: {fileID: 0} 411 | switchIcons_8: {fileID: 0} 412 | switchIcons_9: {fileID: 0} 413 | switchIcons_10: {fileID: 0} 414 | switchIcons_11: {fileID: 0} 415 | switchIcons_12: {fileID: 0} 416 | switchIcons_13: {fileID: 0} 417 | switchIcons_14: {fileID: 0} 418 | switchIcons_15: {fileID: 0} 419 | switchSmallIcons_0: {fileID: 0} 420 | switchSmallIcons_1: {fileID: 0} 421 | switchSmallIcons_2: {fileID: 0} 422 | switchSmallIcons_3: {fileID: 0} 423 | switchSmallIcons_4: {fileID: 0} 424 | switchSmallIcons_5: {fileID: 0} 425 | switchSmallIcons_6: {fileID: 0} 426 | switchSmallIcons_7: {fileID: 0} 427 | switchSmallIcons_8: {fileID: 0} 428 | switchSmallIcons_9: {fileID: 0} 429 | switchSmallIcons_10: {fileID: 0} 430 | switchSmallIcons_11: {fileID: 0} 431 | switchSmallIcons_12: {fileID: 0} 432 | switchSmallIcons_13: {fileID: 0} 433 | switchSmallIcons_14: {fileID: 0} 434 | switchSmallIcons_15: {fileID: 0} 435 | switchManualHTML: 436 | switchAccessibleURLs: 437 | switchLegalInformation: 438 | switchMainThreadStackSize: 1048576 439 | switchPresenceGroupId: 440 | switchLogoHandling: 0 441 | switchReleaseVersion: 0 442 | switchDisplayVersion: 1.0.0 443 | switchStartupUserAccount: 0 444 | switchTouchScreenUsage: 0 445 | switchSupportedLanguagesMask: 0 446 | switchLogoType: 0 447 | switchApplicationErrorCodeCategory: 448 | switchUserAccountSaveDataSize: 0 449 | switchUserAccountSaveDataJournalSize: 0 450 | switchApplicationAttribute: 0 451 | switchCardSpecSize: -1 452 | switchCardSpecClock: -1 453 | switchRatingsMask: 0 454 | switchRatingsInt_0: 0 455 | switchRatingsInt_1: 0 456 | switchRatingsInt_2: 0 457 | switchRatingsInt_3: 0 458 | switchRatingsInt_4: 0 459 | switchRatingsInt_5: 0 460 | switchRatingsInt_6: 0 461 | switchRatingsInt_7: 0 462 | switchRatingsInt_8: 0 463 | switchRatingsInt_9: 0 464 | switchRatingsInt_10: 0 465 | switchRatingsInt_11: 0 466 | switchRatingsInt_12: 0 467 | switchLocalCommunicationIds_0: 468 | switchLocalCommunicationIds_1: 469 | switchLocalCommunicationIds_2: 470 | switchLocalCommunicationIds_3: 471 | switchLocalCommunicationIds_4: 472 | switchLocalCommunicationIds_5: 473 | switchLocalCommunicationIds_6: 474 | switchLocalCommunicationIds_7: 475 | switchParentalControl: 0 476 | switchAllowsScreenshot: 1 477 | switchAllowsVideoCapturing: 1 478 | switchAllowsRuntimeAddOnContentInstall: 0 479 | switchDataLossConfirmation: 0 480 | switchUserAccountLockEnabled: 0 481 | switchSystemResourceMemory: 16777216 482 | switchSupportedNpadStyles: 22 483 | switchNativeFsCacheSize: 32 484 | switchIsHoldTypeHorizontal: 0 485 | switchSupportedNpadCount: 8 486 | switchSocketConfigEnabled: 0 487 | switchTcpInitialSendBufferSize: 32 488 | switchTcpInitialReceiveBufferSize: 64 489 | switchTcpAutoSendBufferSizeMax: 256 490 | switchTcpAutoReceiveBufferSizeMax: 256 491 | switchUdpSendBufferSize: 9 492 | switchUdpReceiveBufferSize: 42 493 | switchSocketBufferEfficiency: 4 494 | switchSocketInitializeEnabled: 1 495 | switchNetworkInterfaceManagerInitializeEnabled: 1 496 | switchPlayerConnectionEnabled: 1 497 | switchUseNewStyleFilepaths: 0 498 | switchUseMicroSleepForYield: 1 499 | switchMicroSleepForYieldTime: 25 500 | ps4NPAgeRating: 12 501 | ps4NPTitleSecret: 502 | ps4NPTrophyPackPath: 503 | ps4ParentalLevel: 11 504 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 505 | ps4Category: 0 506 | ps4MasterVersion: 01.00 507 | ps4AppVersion: 01.00 508 | ps4AppType: 0 509 | ps4ParamSfxPath: 510 | ps4VideoOutPixelFormat: 0 511 | ps4VideoOutInitialWidth: 1920 512 | ps4VideoOutBaseModeInitialWidth: 1920 513 | ps4VideoOutReprojectionRate: 60 514 | ps4PronunciationXMLPath: 515 | ps4PronunciationSIGPath: 516 | ps4BackgroundImagePath: 517 | ps4StartupImagePath: 518 | ps4StartupImagesFolder: 519 | ps4IconImagesFolder: 520 | ps4SaveDataImagePath: 521 | ps4SdkOverride: 522 | ps4BGMPath: 523 | ps4ShareFilePath: 524 | ps4ShareOverlayImagePath: 525 | ps4PrivacyGuardImagePath: 526 | ps4ExtraSceSysFile: 527 | ps4NPtitleDatPath: 528 | ps4RemotePlayKeyAssignment: -1 529 | ps4RemotePlayKeyMappingDir: 530 | ps4PlayTogetherPlayerCount: 0 531 | ps4EnterButtonAssignment: 1 532 | ps4ApplicationParam1: 0 533 | ps4ApplicationParam2: 0 534 | ps4ApplicationParam3: 0 535 | ps4ApplicationParam4: 0 536 | ps4DownloadDataSize: 0 537 | ps4GarlicHeapSize: 2048 538 | ps4ProGarlicHeapSize: 2560 539 | playerPrefsMaxSize: 32768 540 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 541 | ps4pnSessions: 1 542 | ps4pnPresence: 1 543 | ps4pnFriends: 1 544 | ps4pnGameCustomData: 1 545 | playerPrefsSupport: 0 546 | enableApplicationExit: 0 547 | resetTempFolder: 1 548 | restrictedAudioUsageRights: 0 549 | ps4UseResolutionFallback: 0 550 | ps4ReprojectionSupport: 0 551 | ps4UseAudio3dBackend: 0 552 | ps4UseLowGarlicFragmentationMode: 1 553 | ps4SocialScreenEnabled: 0 554 | ps4ScriptOptimizationLevel: 0 555 | ps4Audio3dVirtualSpeakerCount: 14 556 | ps4attribCpuUsage: 0 557 | ps4PatchPkgPath: 558 | ps4PatchLatestPkgPath: 559 | ps4PatchChangeinfoPath: 560 | ps4PatchDayOne: 0 561 | ps4attribUserManagement: 0 562 | ps4attribMoveSupport: 0 563 | ps4attrib3DSupport: 0 564 | ps4attribShareSupport: 0 565 | ps4attribExclusiveVR: 0 566 | ps4disableAutoHideSplash: 0 567 | ps4videoRecordingFeaturesUsed: 0 568 | ps4contentSearchFeaturesUsed: 0 569 | ps4CompatibilityPS5: 0 570 | ps4AllowPS5Detection: 0 571 | ps4GPU800MHz: 1 572 | ps4attribEyeToEyeDistanceSettingVR: 0 573 | ps4IncludedModules: [] 574 | ps4attribVROutputEnabled: 0 575 | monoEnv: 576 | splashScreenBackgroundSourceLandscape: {fileID: 0} 577 | splashScreenBackgroundSourcePortrait: {fileID: 0} 578 | blurSplashScreenBackground: 1 579 | spritePackerPolicy: 580 | webGLMemorySize: 16 581 | webGLExceptionSupport: 1 582 | webGLNameFilesAsHashes: 0 583 | webGLDataCaching: 1 584 | webGLDebugSymbols: 0 585 | webGLEmscriptenArgs: 586 | webGLModulesDirectory: 587 | webGLTemplate: APPLICATION:Default 588 | webGLAnalyzeBuildSize: 0 589 | webGLUseEmbeddedResources: 0 590 | webGLCompressionFormat: 1 591 | webGLWasmArithmeticExceptions: 0 592 | webGLLinkerTarget: 1 593 | webGLThreadsSupport: 0 594 | webGLDecompressionFallback: 0 595 | scriptingDefineSymbols: {} 596 | additionalCompilerArguments: {} 597 | platformArchitecture: {} 598 | scriptingBackend: {} 599 | il2cppCompilerConfiguration: {} 600 | managedStrippingLevel: {} 601 | incrementalIl2cppBuild: {} 602 | suppressCommonWarnings: 1 603 | allowUnsafeCode: 0 604 | useDeterministicCompilation: 1 605 | enableRoslynAnalyzers: 1 606 | additionalIl2CppArgs: 607 | scriptingRuntimeVersion: 1 608 | gcIncremental: 1 609 | assemblyVersionValidation: 1 610 | gcWBarrierValidation: 0 611 | apiCompatibilityLevelPerPlatform: 612 | Standalone: 3 613 | m_RenderingPath: 1 614 | m_MobileRenderingPath: 1 615 | metroPackageName: Template_3D 616 | metroPackageVersion: 617 | metroCertificatePath: 618 | metroCertificatePassword: 619 | metroCertificateSubject: 620 | metroCertificateIssuer: 621 | metroCertificateNotAfter: 0000000000000000 622 | metroApplicationDescription: Template_3D 623 | wsaImages: {} 624 | metroTileShortName: 625 | metroTileShowName: 0 626 | metroMediumTileShowName: 0 627 | metroLargeTileShowName: 0 628 | metroWideTileShowName: 0 629 | metroSupportStreamingInstall: 0 630 | metroLastRequiredScene: 0 631 | metroDefaultTileSize: 1 632 | metroTileForegroundText: 2 633 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 634 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} 635 | metroSplashScreenUseBackgroundColor: 0 636 | platformCapabilities: {} 637 | metroTargetDeviceFamilies: {} 638 | metroFTAName: 639 | metroFTAFileTypes: [] 640 | metroProtocolName: 641 | XboxOneProductId: 642 | XboxOneUpdateKey: 643 | XboxOneSandboxId: 644 | XboxOneContentId: 645 | XboxOneTitleId: 646 | XboxOneSCId: 647 | XboxOneGameOsOverridePath: 648 | XboxOnePackagingOverridePath: 649 | XboxOneAppManifestOverridePath: 650 | XboxOneVersion: 1.0.0.0 651 | XboxOnePackageEncryption: 0 652 | XboxOnePackageUpdateGranularity: 2 653 | XboxOneDescription: 654 | XboxOneLanguage: 655 | - enus 656 | XboxOneCapability: [] 657 | XboxOneGameRating: {} 658 | XboxOneIsContentPackage: 0 659 | XboxOneEnhancedXboxCompatibilityMode: 0 660 | XboxOneEnableGPUVariability: 1 661 | XboxOneSockets: {} 662 | XboxOneSplashScreen: {fileID: 0} 663 | XboxOneAllowedProductIds: [] 664 | XboxOnePersistentLocalStorageSize: 0 665 | XboxOneXTitleMemory: 8 666 | XboxOneOverrideIdentityName: 667 | XboxOneOverrideIdentityPublisher: 668 | vrEditorSettings: {} 669 | cloudServicesEnabled: 670 | UNet: 1 671 | luminIcon: 672 | m_Name: 673 | m_ModelFolderPath: 674 | m_PortalFolderPath: 675 | luminCert: 676 | m_CertPath: 677 | m_SignPackage: 1 678 | luminIsChannelApp: 0 679 | luminVersion: 680 | m_VersionCode: 1 681 | m_VersionName: 682 | apiCompatibilityLevel: 6 683 | activeInputHandler: 2 684 | cloudProjectId: 685 | framebufferDepthMemorylessMode: 0 686 | qualitySettingsNames: [] 687 | projectName: 688 | organizationId: 689 | cloudEnabled: 0 690 | legacyClampBlendShapeWeights: 0 691 | virtualTexturingSupportEnabled: 0 692 | --------------------------------------------------------------------------------