├── Scripts ├── ExpShardItem.cs ├── Map.meta ├── Player.meta ├── UI.meta ├── Entities.meta ├── Management.meta ├── SaveData.meta ├── SoundSystem.meta ├── Weapons.meta ├── SoundSystem │ ├── AmbientAudioSource.prefab.meta │ ├── ForestBGM.asset.meta │ ├── GameEvents.cs.meta │ ├── SFXPlayer.cs.meta │ ├── AmbiencePlayer.cs.meta │ ├── AudioPointPlayer.cs.meta │ ├── DynamicBGMPlayer.cs.meta │ ├── FixedBGMPlayer.cs.meta │ ├── IAudioRequester.cs.meta │ ├── MusicElement.cs.meta │ ├── MusicElement.cs │ ├── ForestBGM.asset │ ├── FixedBGMPlayer.cs │ ├── AudioPointPlayer.cs │ ├── SFXPlayer.cs │ ├── GameEvents.cs │ ├── IAudioRequester.cs │ ├── DynamicBGMPlayer.cs │ ├── AmbiencePlayer.cs │ └── AmbientAudioSource.prefab ├── Map │ ├── SerializableDictionary.meta │ ├── Cell.cs.meta │ ├── Prototype.cs.meta │ ├── Weights.cs.meta │ ├── MapGenerator.cs.meta │ ├── PrototypeGenerator.cs.meta │ ├── WaveFunctionCollapse.cs.meta │ ├── SerializableDictionary │ │ ├── SerializableHashSet.cs.meta │ │ ├── SerializableDictionary.cs.meta │ │ ├── DebugUtils.cs.meta │ │ ├── SerializableDictionaryExample.cs.meta │ │ ├── UserSerializableDictionaries.cs.meta │ │ ├── DebugUtils.cs │ │ ├── UserSerializableDictionaries.cs │ │ ├── SerializableDictionaryExample.cs │ │ ├── SerializableHashSet.cs │ │ └── SerializableDictionary.cs │ ├── MapGenerator.cs │ ├── Weights.cs │ ├── Prototype.cs │ ├── Cell.cs │ └── PrototypeGenerator.cs ├── SaveData │ ├── Ammo.asset.meta │ ├── FireRate.asset.meta │ ├── MetaProgressionSO.cs │ ├── SaveSystem.cs.meta │ ├── JSONFileHandler.cs.meta │ ├── MetaProgressionSO.cs.meta │ ├── MetaProgressionManager.cs.meta │ ├── Ammo.asset │ ├── FireRate.asset │ ├── JSONFileHandler.cs │ ├── MetaProgressionManager.cs │ └── SaveSystem.cs ├── WeaponType.cs ├── Entities │ ├── IDamageable.cs │ ├── Enemy.cs.meta │ ├── Junkie.cs.meta │ ├── MechBoss.cs.meta │ ├── Opperator.cs.meta │ ├── Zombie.cs.meta │ ├── IDamageable.cs.meta │ ├── LivingEntity.cs.meta │ ├── Zombie.cs │ ├── LivingEntity.cs │ ├── Junkie.cs │ ├── Opperator.cs │ ├── MechBoss.cs │ └── Enemy.cs ├── CyberwareUpgrade.cs ├── Drone.cs.meta ├── ExpShard.cs ├── ExpShard.cs.meta ├── MainMenu.cs.meta ├── Upgrade.cs.meta ├── AngelFire.cs.meta ├── CameraFollow.cs.meta ├── ExpShardItem.cs.meta ├── Explosion.cs.meta ├── FadingObject.cs.meta ├── SpawnBlocker.cs.meta ├── SwordCollider.cs.meta ├── UI │ ├── PlayerUI.cs.meta │ ├── RipperDoc.cs.meta │ ├── UIManager.cs.meta │ ├── UpgradeUI.cs.meta │ ├── WeaponUI.cs.meta │ ├── ButtonHighlight.cs.meta │ ├── CyberUpgradesUI.cs.meta │ ├── GunStoreManager.cs.meta │ ├── MetaProgressionUI.cs.meta │ ├── CyberUpgradesUI.cs │ ├── ButtonHighlight.cs │ ├── RipperDoc.cs │ ├── GunStoreManager.cs │ ├── WeaponUI.cs │ ├── PlayerUI.cs │ ├── UpgradeUI.cs │ └── MetaProgressionUI.cs ├── WeaponManager.cs.meta ├── WeaponType.cs.meta ├── AngelFireObject.cs.meta ├── BuildingRandomizer.cs.meta ├── CyberwareUpgrade.cs.meta ├── ExtensionMethods.cs.meta ├── IconScreenShotter.cs.meta ├── Management │ ├── Spawner.cs.meta │ ├── GameManager.cs.meta │ ├── GameStateManager.cs.meta │ ├── PostGameManager.cs.meta │ ├── GameManager.cs │ ├── PostGameManager.cs │ ├── Spawner.cs │ └── GameStateManager.cs ├── Player │ ├── PlayerStats.cs.meta │ ├── Sandevistan.cs.meta │ ├── CyberwareManager.cs.meta │ ├── InputHandler.cs.meta │ ├── PlayerControls.cs.meta │ ├── PlayerManager.cs.meta │ ├── PlayerMovement.cs.meta │ ├── PlayerControls.inputactions.meta │ ├── CyberwareManager.cs │ ├── InputHandler.cs │ ├── PlayerMovement.cs │ ├── Sandevistan.cs │ └── PlayerStats.cs ├── ResetAnimatorBool.cs.meta ├── RewardsManager.cs.meta ├── ScreenshotHandler.cs.meta ├── UpgradeManager.cs.meta ├── UpgradeRenders.cs.meta ├── SteamAchievementManager.cs.meta ├── FadeObjectBlockingObject.cs.meta ├── ResetAnimatorBool.cs ├── BuildingRandomizer.cs ├── CameraFollow.cs ├── SwordCollider.cs ├── Upgrade.cs ├── Explosion.cs ├── UpgradeRenders.cs ├── FadingObject.cs ├── AngelFireObject.cs ├── SpawnBlocker.cs ├── SteamAchievementManager.cs ├── IconScreenShotter.cs ├── RewardsManager.cs ├── AngelFire.cs ├── WeaponManager.cs ├── MainMenu.cs ├── Drone.cs ├── ExtensionMethods.cs ├── UpgradeManager.cs ├── ScreenshotHandler.cs └── FadeObjectBlockingObject.cs ├── Editor ├── WFCEditor.cs.meta ├── SaveEditor.cs.meta ├── DebugUtilsEditor.cs.meta ├── PrototypeEditor.cs.meta ├── SerializableDictionaryPropertyDrawer.cs.meta ├── PrototypeEditor.cs ├── SaveEditor.cs ├── WFCEditor.cs └── DebugUtilsEditor.cs └── .gitignore /Scripts/ExpShardItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class ExpShardItem : MonoBehaviour 6 | { 7 | public ExpShard expShard; 8 | } 9 | -------------------------------------------------------------------------------- /Scripts/Map.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64ad9f757ad4c0d4fa74bf50f9b3d0c2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/Player.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca5402fa55c336542b540b176369bdb9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/UI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0dbdb12c0f2690544b62c51860f5015e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/Entities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e4afbe4ae7eb4a44823415916ee2315 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/Management.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: caa74fbbd17cb484a883c2f588655482 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/SaveData.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b423efb0fbb20a45befc9bc8d5d301b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/SoundSystem.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3a5f6f7facf0ec4ca37b07e19f63d29 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/Weapons.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b08868f4317324d47b750605aa05d0c3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/AmbientAudioSource.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ebac8528123d9345a7f8747e444fe37 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Scripts/Map/SerializableDictionary.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9756a32c9afbdce4dbde58b08cf78db4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/SaveData/Ammo.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 87a169ad5734d0247a69263a5146ccb5 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/SaveData/FireRate.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a0541e19f9f97a45a891bbd17c3737c 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/ForestBGM.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 951c556a2a277d249b8c39963b5627fe 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/WeaponType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | [CreateAssetMenu (menuName ="ScriptableObjects/WeaponType")] 6 | public class WeaponType : ScriptableObject 7 | { 8 | } 9 | 10 | -------------------------------------------------------------------------------- /Scripts/Entities/IDamageable.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public interface IDamageable 6 | { 7 | void TakeHit(float damage, RaycastHit hit); 8 | void TakeDamage(float damage); 9 | } 10 | -------------------------------------------------------------------------------- /Scripts/SaveData/MetaProgressionSO.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | [CreateAssetMenu (menuName ="ScriptableObjects/MetaProgressionSO")] 6 | public class MetaProgressionSO : ScriptableObject 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Scripts/CyberwareUpgrade.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | [CreateAssetMenu(menuName = "ScriptableObjects/CyberwareUpgrade")] 6 | public class CyberwareUpgrade : Upgrade 7 | { 8 | public CyberwareType cyberwareType; 9 | } 10 | -------------------------------------------------------------------------------- /Editor/WFCEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fc3def61dd5b264a9d3304e000476ce 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Drone.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4d35ddacb08e3b44a64de730b7a2bc9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/ExpShard.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | [CreateAssetMenu (menuName ="ScriptableObjects/ExpShard")] 5 | public class ExpShard : ScriptableObject 6 | { 7 | public GameObject shardPrefab; 8 | public float expAmount; 9 | } 10 | -------------------------------------------------------------------------------- /Scripts/ExpShard.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ea408194b3011c4ba4c41bd25d33e29 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MainMenu.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 20367861838dc9f439aa235c73e5f0fd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Map/Cell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4fa56b24b27ebab479dc051964ad20ee 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Upgrade.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3846dd3cce722eb4ba1cee459e18d1c2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/SaveEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f68b4074925272b4da7430d85f9f6ca4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/AngelFire.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ae315388ca4b3b46b6d5ec7d601801f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/CameraFollow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec082aeb0b5cc3d4f91c78bdea914da5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/ExpShardItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c08658cf16a2f054da060f68b1a273dd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Explosion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e4e0642a2af16a42875f9a28e479da2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/FadingObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d589a281c288a554596578e40ceb98c6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Map/Prototype.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95120132be1ef2043bc8bb6dc11fb61c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Map/Weights.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfe7a4fd12b2eff42b05b0dc168340fe 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SpawnBlocker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12e3adf3a1a94a2499d2903212ecd243 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SwordCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e499272c827210f44845f76a85e7eda0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/UI/PlayerUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: adb2f78d54b120347bce48dd70beabd2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/UI/RipperDoc.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ced050811a34ec40bce9f98fcf2c2eb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/UI/UIManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2cd6f84929e2e7469cf65969fe0f4f2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/UI/UpgradeUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41b63849fbc79324d9c0e8192d00025e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/UI/WeaponUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be590716ff6ec984c9abafa5b0fa2a5a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/WeaponManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f51de408b96e7047998c9f18001e1ee 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/WeaponType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e811083ed215ce4ca8ee58afd7a3680 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/DebugUtilsEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56de5b300fa8b9d4ebca16af189f5e45 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/PrototypeEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4aa4c8848186df49b2df8e9b2826d0b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/AngelFireObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa2ff15dd907378449b327ddb422ef5a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/BuildingRandomizer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 178912e129e997f4891fd82f1c0491d5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/CyberwareUpgrade.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 20d6db436a5ef6b4599858ecc942e1e8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Entities/Enemy.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f91ce2780c2c824439f229ab23f943cc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Entities/Junkie.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ebc8da7e17e3e944a2fdf1fcfc3f576 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Entities/MechBoss.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f6d7fdbe28d18048abdefa3d2cf4bd1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Entities/Opperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8efc4f3eb35921741a167328fd374ce7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Entities/Zombie.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f141ee1882828445bd10b65e7137940 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/ExtensionMethods.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f450d5221601af44db76c27e2647e397 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/IconScreenShotter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 36cb512ffaa46914a9fdf75b2a5cdcf5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Management/Spawner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3bd42623294420b429991508c6d026b9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Map/MapGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26a4e24a17350c349bb2bd93215cddc5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Player/PlayerStats.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf25942b52f885e4c8dd5ca7b380ae81 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Player/Sandevistan.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a7742203d32f224798a0ca3e063d8b5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/ResetAnimatorBool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e08de22bd3f7ae4c89be5ab1ed95cf5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/RewardsManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1e1b27ec38b6c546aba704c523f325a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/ScreenshotHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d16f949fec7bdc4dab7b6486e7c734c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/UI/ButtonHighlight.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 567103f5e301dfc4f8799863bc659c39 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/UI/CyberUpgradesUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b069be9a0022ec4a89356d47b9ee88a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/UI/GunStoreManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a74c923202ce6524a82ba3b689d245f3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/UpgradeManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69cb234f400f94b43bbe5b6ad2b7b83b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/UpgradeRenders.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 807a6d985cc0cb14da1972a96f4029e7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Entities/IDamageable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c949177e31fd0274e843593ffb45f506 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Entities/LivingEntity.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88d113154260eb048b2469f8c16892a2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Management/GameManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c50ae4d080c12ca4db4d96d7b49589f6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Map/PrototypeGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86dafb9ac20f07849bd20b84a4e889c7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Player/CyberwareManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30c293b10f543f044a191fc5fff562c2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Player/InputHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 322cd4a4ed29f9d4aa3e281187fb0e6b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Player/PlayerControls.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25eefcbec432c5d48ba4b234cd917ae6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Player/PlayerManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8718c0d5f2ab6b643bea3f33a4e7593f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Player/PlayerMovement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc7c14b5eed8bb340b3e6d5febd6f60f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SaveData/SaveSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1791fa5b45bf3a44db7021591082bdbd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/GameEvents.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b6c45e2d013b0740ae97bb03f8235db 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/SFXPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e53b426aab18f74e95351fbf0bd5d93 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SteamAchievementManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a205ed11157c6b540ac06fff30176967 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/UI/MetaProgressionUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a32d98ab7a696d3478994333e366e061 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/FadeObjectBlockingObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d40562941935c04d8ba96a25da4cebc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Management/GameStateManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a0a77c29789c744b8f692f3ef18e723 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Management/PostGameManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8dc7326b73be94c4994f1a8f4a793197 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Map/WaveFunctionCollapse.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e6f9d0feb545a3439e8211d4a1e9b54 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SaveData/JSONFileHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1be196c0417fdb046a4d02ab1abcc944 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SaveData/MetaProgressionSO.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f07465d66269364ea63c84f48469c4a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/AmbiencePlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd763ac2fa4e61146a6cf8f26363e733 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/AudioPointPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f32baa4b05a9fa40a45c303a938fbb7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/DynamicBGMPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbc57aadb57bda741a861a0ac3924218 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/FixedBGMPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae84f3bad0c5da748a476de74756a25f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/IAudioRequester.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70ef43e4065855c44a9158a07b5acd36 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/MusicElement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0fdeec95b94b478479f26be7e416c10f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SaveData/MetaProgressionManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe044cf4b55a75d479d75ffa4d83e551 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/SerializableDictionaryPropertyDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 612c418132e38e44eb8f663dfe7ea61a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/MusicElement.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace TJAudio 6 | { 7 | [CreateAssetMenu(menuName = "ScriptableObjects/MusicElement")] 8 | public class MusicElement : ScriptableObject 9 | { 10 | public AudioClip introClip, loopClip; 11 | } 12 | } -------------------------------------------------------------------------------- /Scripts/Map/SerializableDictionary/SerializableHashSet.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dfb76d088b0c00540917ba196b375e41 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Map/SerializableDictionary/SerializableDictionary.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 863a832ae2d6fc646b1cbae390629570 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Map/SerializableDictionary/DebugUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31cc353e47e40934c82f169f9468c198 3 | timeCreated: 1493477885 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Scripts/Map/SerializableDictionary/SerializableDictionaryExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5ff00a74ccb984498070d9930a7944c 3 | timeCreated: 1492868873 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Scripts/Map/SerializableDictionary/UserSerializableDictionaries.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd910530dd8f6b5429c65a494644ed09 3 | timeCreated: 1493639913 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Scripts/Map/MapGenerator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class MapGenerator : MonoBehaviour 6 | { 7 | // Start is called before the first frame update 8 | void Start() 9 | { 10 | 11 | } 12 | 13 | // Update is called once per frame 14 | void Update() 15 | { 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Scripts/SaveData/Ammo.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: 43c9df58b8ed4aa43bd451d817311573, type: 3} 13 | m_Name: Ammo 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /Scripts/Player/PlayerControls.inputactions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 854a5e7285b5acd499aaf73e970e13b8 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: 15 | -------------------------------------------------------------------------------- /Scripts/SaveData/FireRate.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: 43c9df58b8ed4aa43bd451d817311573, type: 3} 13 | m_Name: FireRate 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /Scripts/UI/CyberUpgradesUI.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using TMPro; 6 | public class CyberUpgradesUI : MonoBehaviour 7 | { 8 | public Image cyberUpgradeImage; 9 | public Slider cyberUpgradeSlider; 10 | public CyberwareType cyberUpgradeType; 11 | public Color activeColor, inactiveColor; 12 | public TMP_Text hotkeyText; 13 | public Image hotkeyImage; 14 | } 15 | -------------------------------------------------------------------------------- /Scripts/ResetAnimatorBool.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | public class ResetAnimatorBool : StateMachineBehaviour 5 | { 6 | public string[] Bool; 7 | public bool[] Status; 8 | override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) 9 | { 10 | for(int i = 0; i < Bool.Length; i++) 11 | animator.SetBool(Bool[i], Status[i]); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Scripts/Entities/Zombie.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class Zombie : MonoBehaviour 6 | { 7 | [SerializeField] private SkinnedMeshRenderer[] meshRenderers; 8 | private void Awake() 9 | { 10 | SkinnedMeshRenderer meshRenderer = meshRenderers[Random.Range(0, meshRenderers.Length)]; 11 | meshRenderer.gameObject.SetActive(true); 12 | GetComponent().meshRenderer = meshRenderer; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Scripts/BuildingRandomizer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class BuildingRandomizer : MonoBehaviour 6 | { 7 | public void RandomizeBuilding() 8 | { 9 | int randomNumber = UnityEngine.Random.Range(0, transform.childCount); 10 | 11 | foreach (Transform child in transform) 12 | child.gameObject.SetActive(false); 13 | 14 | transform.GetChild(randomNumber).gameObject.SetActive(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Scripts/Management/GameManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class GameManager : MonoBehaviour 6 | { 7 | public static GameManager instance; 8 | public SaveSystem saveSystem; 9 | public MetaProgressionManager metaProgressionManager; 10 | private void Awake() 11 | { 12 | if (instance == null) 13 | instance = this; 14 | else 15 | Destroy(gameObject); 16 | 17 | DontDestroyOnLoad(gameObject); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Editor/PrototypeEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEditor; 4 | 5 | [CustomEditor (typeof (PrototypeGenerator))] 6 | public class PrototypeEditor : Editor { 7 | 8 | public override void OnInspectorGUI() { 9 | PrototypeGenerator prototypeGenerator = (PrototypeGenerator)target; 10 | base.OnInspectorGUI(); 11 | 12 | if (GUILayout.Button ("Generate Prototypes")) { 13 | prototypeGenerator.GeneratePrototypes(); 14 | } 15 | if (GUILayout.Button ("Display Prototypes")) { 16 | prototypeGenerator.DisplayPrototypes(); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Scripts/UI/ButtonHighlight.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | public class ButtonHighlight : MonoBehaviour 7 | { 8 | [SerializeField] private Image buttonImage; 9 | [SerializeField] private Color highlightedColor; 10 | Color normalColor; 11 | public void OnPointerEnter() 12 | { 13 | normalColor = buttonImage.color; 14 | buttonImage.color = highlightedColor; 15 | } 16 | public void OnPointerExit() 17 | { 18 | buttonImage.color = normalColor; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/ForestBGM.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: 0fdeec95b94b478479f26be7e416c10f, type: 3} 13 | m_Name: ForestBGM 14 | m_EditorClassIdentifier: 15 | introClip: {fileID: 8300000, guid: d92d1bbac6fda6540a6c7dd8bfdd5b16, type: 3} 16 | loopClip: {fileID: 8300000, guid: d92d1bbac6fda6540a6c7dd8bfdd5b16, type: 3} 17 | -------------------------------------------------------------------------------- /Editor/SaveEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEditor; 4 | 5 | [CustomEditor (typeof (SaveSystem))] 6 | public class SaveEditor : Editor { 7 | 8 | public override void OnInspectorGUI() { 9 | SaveSystem saveSystem = (SaveSystem)target; 10 | base.OnInspectorGUI(); 11 | 12 | if (GUILayout.Button ("Wipe Save File")) { 13 | saveSystem.WipeSaveData(); 14 | } 15 | if (GUILayout.Button ("Add Resources")) { 16 | saveSystem.AddResources(); 17 | } 18 | if(GUILayout.Button ("Open Save Folder")) { 19 | EditorUtility.RevealInFinder(Application.persistentDataPath); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Scripts/CameraFollow.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class CameraFollow : MonoBehaviour 6 | { 7 | public Transform target; 8 | public float smoothSpeed = 0.125f; 9 | public Vector3 offset; 10 | private void FixedUpdate() 11 | { 12 | if(target==null) 13 | return; 14 | 15 | Vector3 desiredPosition = target.position + offset; 16 | Vector3 smoothedPosition = Vector3.Lerp(transform.position, desiredPosition, smoothSpeed * Time.deltaTime); 17 | transform.position = smoothedPosition; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Scripts/SwordCollider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SwordCollider : MonoBehaviour 6 | { 7 | [SerializeField] private float damage; 8 | public string tagToHit; 9 | public Collider collider; 10 | public void SetStats(float _damage) 11 | { 12 | damage = _damage; 13 | } 14 | private void OnTriggerEnter(Collider other) 15 | { 16 | if(other.gameObject.tag==tagToHit) 17 | { 18 | IDamageable damageable = other.gameObject.GetComponent(); 19 | damageable.TakeDamage(damage); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Editor/WFCEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEditor; 4 | using System.Collections.Generic; 5 | 6 | [CustomEditor (typeof (WaveFunctionCollapse))] 7 | public class WFCEditor : Editor { 8 | 9 | public override void OnInspectorGUI() { 10 | WaveFunctionCollapse waveFunctionCollapse = (WaveFunctionCollapse)target; 11 | base.OnInspectorGUI(); 12 | 13 | if (GUILayout.Button ("Generate Prototypes")) { 14 | waveFunctionCollapse.InitializeWaveFunction(); 15 | } 16 | if (GUILayout.Button ("Clear")) { 17 | waveFunctionCollapse.ClearAll(); 18 | } 19 | if (GUILayout.Button ("Collapse")) { 20 | waveFunctionCollapse.StartCollapse(); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Scripts/Map/SerializableDictionary/DebugUtils.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System.Linq; 5 | using System; 6 | 7 | public static class DebugUtils 8 | { 9 | public static string ToString(Array array) 10 | { 11 | if(array == null) 12 | return "null"; 13 | else 14 | return "{" + string.Join(", ", array.Cast().Select(o => o.ToString()).ToArray()) + "}"; 15 | } 16 | 17 | public static string ToString(Dictionary dict) 18 | { 19 | if(dict == null) 20 | return "null"; 21 | else 22 | return "{" + string.Join(", ", dict.Select(kvp => kvp.Key.ToString() + ":" + kvp.Value.ToString()).ToArray()) + "}"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Scripts/Upgrade.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | [CreateAssetMenu (menuName ="ScriptableObjects/Upgrade")] 6 | public class Upgrade : ScriptableObject 7 | { 8 | public string upgradeName; 9 | [TextArea] public string upgradeDescription; 10 | public Sprite upgradeIcon; 11 | public UpgradeLevel[] upgradlevels; 12 | public UpgradeClass upgradeClass; 13 | public enum UpgradeClass {Common,Rare,Legendary,Exotic}; 14 | public UpgradeType upgradeType; 15 | public enum UpgradeType {stat, weapon, cyberware}; 16 | public WeaponType weaponType; 17 | } 18 | [System.Serializable] public struct UpgradeLevel 19 | { 20 | // public int upgradeLevel; 21 | public float upgradeModifier; 22 | } 23 | -------------------------------------------------------------------------------- /Editor/DebugUtilsEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | using System.Text; 6 | 7 | public static class DebugUtilsEditor 8 | { 9 | public static string ToString(SerializedProperty property) 10 | { 11 | StringBuilder sb = new StringBuilder(); 12 | var iterator = property.Copy(); 13 | var end = property.GetEndProperty(); 14 | do 15 | { 16 | sb.AppendLine(iterator.propertyPath + " (" + iterator.type + " " + iterator.propertyType + ") = " 17 | + SerializableDictionaryPropertyDrawer.GetPropertyValue(iterator) 18 | #if UNITY_5_6_OR_NEWER 19 | + (iterator.isArray ? " (" + iterator.arrayElementType + ")" : "") 20 | #endif 21 | ); 22 | } while(iterator.Next(true) && iterator.propertyPath != end.propertyPath); 23 | return sb.ToString(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Scripts/Map/Weights.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | [System.Serializable] public struct Weights 6 | { 7 | [Range(0,10)] public int intersectionWeight; 8 | [Range(0,10)] public int roadStraightWeight; 9 | [Range(0,10)] public int waterWeight; 10 | [Range(0,10)] public int waterBendWeight; 11 | public int GetWeight(Attribute a) 12 | { 13 | if(a==Attribute.Intersection) 14 | return intersectionWeight; 15 | else if(a==Attribute.RoadStraight) 16 | return roadStraightWeight; 17 | else if(a==Attribute.Water) 18 | return waterWeight; 19 | else if(a==Attribute.WaterBend) 20 | return waterBendWeight; 21 | 22 | return 0; 23 | } 24 | } 25 | public enum Attribute {Intersection, RoadStraight, Water, WaterBend}; 26 | -------------------------------------------------------------------------------- /Scripts/UI/RipperDoc.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using TMPro; 5 | 6 | public class RipperDoc : MonoBehaviour 7 | { 8 | public List metaProgressionUIs; 9 | public TMP_Text currencyText; 10 | 11 | private void Start() 12 | { 13 | LoadMetaProgression(); 14 | } 15 | private void Update() 16 | { 17 | currencyText.text = GameManager.instance.saveSystem.GetCurrency().ToString(); 18 | } 19 | public void LoadMetaProgression() 20 | { 21 | List metaProgressionContainers = GameManager.instance.metaProgressionManager.LoadMetaProgression(); 22 | for (int i = 0; i < metaProgressionContainers.Count; i++) 23 | { 24 | metaProgressionUIs[i].LoadMetaUI(metaProgressionContainers[i]); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Scripts/Explosion.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class Explosion : MonoBehaviour 6 | { 7 | public SphereCollider sphereCollider; 8 | [SerializeField] private float damage = 10f; 9 | private void Start() 10 | { 11 | StartCoroutine(Flash()); 12 | } 13 | private void OnTriggerEnter(Collider other) 14 | { 15 | Debug.Log($"{other.gameObject.name} hit"); 16 | if (other.gameObject.CompareTag("Player")) 17 | { 18 | Debug.Log($"Player hit"); 19 | PlayerManager.instance.TakeDamage(damage); 20 | } 21 | } 22 | public IEnumerator Flash() 23 | { 24 | sphereCollider.enabled = true; 25 | Debug.Log($"EXPLODING "); 26 | yield return new WaitForSeconds(0.1f); 27 | sphereCollider.enabled = false; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/FixedBGMPlayer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace TJAudio 6 | { 7 | public class FixedBGMPlayer : MonoBehaviour 8 | { 9 | [SerializeField] private AudioSource audioSource; 10 | [SerializeField] private MusicElement defaultBGM; 11 | 12 | private void Start() 13 | { 14 | StartCoroutine(PlayClips(defaultBGM)); 15 | } 16 | public IEnumerator PlayClips(MusicElement musicElement) 17 | { 18 | audioSource.clip = musicElement.introClip; 19 | audioSource.loop = false; 20 | audioSource.Play(); 21 | yield return new WaitForSeconds(audioSource.clip.length); 22 | audioSource.clip = musicElement.loopClip; 23 | audioSource.loop = true; 24 | audioSource.Play(); 25 | } 26 | public void SetVolumeLevel(float value) 27 | { 28 | audioSource.volume = value; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Scripts/Map/SerializableDictionary/UserSerializableDictionaries.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System; 4 | using UnityEngine; 5 | 6 | [Serializable] 7 | public class StringStringDictionary : SerializableDictionary {} 8 | 9 | [Serializable] 10 | public class ObjectColorDictionary : SerializableDictionary {} 11 | 12 | [Serializable] 13 | public class ColorArrayStorage : SerializableDictionary.Storage {} 14 | 15 | [Serializable] 16 | public class StringColorArrayDictionary : SerializableDictionary {} 17 | 18 | [Serializable] 19 | public class MyClass 20 | { 21 | public int i; 22 | public string str; 23 | } 24 | 25 | [Serializable] 26 | public class QuaternionMyClassDictionary : SerializableDictionary {} 27 | 28 | #if NET_4_6 || NET_STANDARD_2_0 29 | [Serializable] 30 | public class StringHashSet : SerializableHashSet {} 31 | #endif 32 | -------------------------------------------------------------------------------- /Scripts/UI/GunStoreManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class GunStoreManager : MonoBehaviour 6 | { 7 | private List weaponTypes; 8 | [SerializeField] private CanvasGroup upgradesCanvasGroup, weaponCanvasGroup; 9 | // [SerializeField] private List weaponStatsUIs; 10 | public void Start() 11 | { 12 | weaponTypes = GameManager.instance.saveSystem.weapons; 13 | } 14 | public void LoadWeaponScreen(WeaponType weaponType) 15 | { 16 | // load the weapon page 17 | // for (int i = 0; i < weaponStatsUIs.Count; i++) 18 | // weaponStatsUIs[i].LoadStat(weaponType, weaponType.weaponModifications[i].weaponModifier); 19 | 20 | upgradesCanvasGroup.Enable(); 21 | weaponCanvasGroup.Disable(); 22 | } 23 | public void CloseWeaponScreen() 24 | { 25 | upgradesCanvasGroup.Disable(); 26 | weaponCanvasGroup.Enable(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Scripts/UpgradeRenders.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class UpgradeRenders : MonoBehaviour 6 | { 7 | public Camera cam; 8 | public RenderTexture renderTexture; 9 | public Transform upgradePrefabsHolder; 10 | public List upgradeAndObjects; 11 | public void LoadUpgrade(Upgrade upgrade) 12 | { 13 | foreach (var item in upgradeAndObjects) 14 | { 15 | if (item.upgrades == upgrade) 16 | { 17 | item.upgradeObject.SetActive(true); 18 | } 19 | else 20 | { 21 | item.upgradeObject.SetActive(false); 22 | } 23 | } 24 | // cam.targetTexture = renderTexture; 25 | // cam.Render(); 26 | // cam.targetTexture = null; 27 | } 28 | } 29 | [System.Serializable] public struct UpgradeAndObject 30 | { 31 | public Upgrade upgrades; 32 | public GameObject upgradeObject; 33 | } 34 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/AudioPointPlayer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace TJAudio 6 | { 7 | public class AudioPointPlayer : MonoBehaviour 8 | { 9 | private AudioSource audioSource; 10 | private bool wasPlayingAudio; 11 | 12 | private void Start() 13 | { 14 | audioSource = GetComponent(); 15 | IAudioRequester.instance.ambiencePlayer.OnAudioEndPlaying += OnAudioEndPlaying; 16 | } 17 | private void Update() 18 | { 19 | if(audioSource.isPlaying) 20 | { 21 | wasPlayingAudio = true; 22 | } 23 | else if(wasPlayingAudio) 24 | { 25 | wasPlayingAudio = false; 26 | OnAudioEndPlaying(); 27 | } 28 | } 29 | public void OnAudioEndPlaying() 30 | { 31 | Debug.Log($"we're done playing {audioSource.clip.name}"); 32 | IAudioRequester.instance.ambiencePlayer.OnAudioSourceFreedHandler(audioSource); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Scripts/Entities/LivingEntity.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class LivingEntity : MonoBehaviour, IDamageable 6 | { 7 | public float startingHealth; 8 | [SerializeField] protected float health; 9 | public float Health => health; 10 | protected bool dead; 11 | public event System.Action OnDeath; 12 | public event System.Action OnDamage; 13 | 14 | protected virtual void Start(){ 15 | health = startingHealth; 16 | } 17 | public void TakeDamage(float damage){ 18 | // Debug.Log($"took damage"); 19 | if(OnDamage != null) 20 | OnDamage(damage); 21 | } 22 | public void TakeHit(float damage, RaycastHit hit) 23 | { 24 | Debug.Log($"took hit"); 25 | health -= damage; 26 | 27 | if(health<=0&&!dead){ 28 | Die(); 29 | } 30 | } 31 | public void Die(){ 32 | dead = true; 33 | if(OnDeath != null) 34 | OnDeath(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Scripts/Map/SerializableDictionary/SerializableDictionaryExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SerializableDictionaryExample : MonoBehaviour { 6 | // The dictionaries can be accessed throught a property 7 | [SerializeField] 8 | StringStringDictionary m_stringStringDictionary = null; 9 | public IDictionary StringStringDictionary 10 | { 11 | get { return m_stringStringDictionary; } 12 | set { m_stringStringDictionary.CopyFrom (value); } 13 | } 14 | 15 | public ObjectColorDictionary m_objectColorDictionary; 16 | public StringColorArrayDictionary m_stringColorArrayDictionary; 17 | #if NET_4_6 || NET_STANDARD_2_0 18 | public StringHashSet m_stringHashSet; 19 | #endif 20 | 21 | void Reset () 22 | { 23 | // access by property 24 | StringStringDictionary = new Dictionary() { {"first key", "value A"}, {"second key", "value B"}, {"third key", "value C"} }; 25 | m_objectColorDictionary = new ObjectColorDictionary() { {gameObject, Color.blue}, {this, Color.red} }; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Scripts/FadingObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class FadingObject : MonoBehaviour, IEquatable 6 | { 7 | public List Renderers = new List(); 8 | public Vector3 Position; 9 | public List Materials = new List(); 10 | [HideInInspector] 11 | public float InitialAlpha; 12 | 13 | private void Awake() 14 | { 15 | Position = transform.position; 16 | 17 | if (Renderers.Count == 0) 18 | { 19 | Renderers.AddRange(GetComponentsInChildren()); 20 | } 21 | foreach(Renderer renderer in Renderers) 22 | { 23 | Materials.AddRange(renderer.materials); 24 | } 25 | 26 | InitialAlpha = Materials[0].color.a; 27 | } 28 | 29 | public bool Equals(FadingObject other) 30 | { 31 | return Position.Equals(other.Position); 32 | } 33 | 34 | public override int GetHashCode() 35 | { 36 | return Position.GetHashCode(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Scripts/Map/Prototype.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | [CreateAssetMenu(menuName = "Prototype")] 6 | public class Prototype : ScriptableObject 7 | { 8 | public int meshRotation; 9 | public GameObject prefab; 10 | public WFC_Socket posX; 11 | public WFC_Socket negX; 12 | public WFC_Socket posZ; 13 | public WFC_Socket negZ; 14 | public List attributes = new List(); 15 | public NeighbourList validNeighbours; 16 | } 17 | [System.Serializable] public class NeighbourList 18 | { 19 | public List posX = new List(); 20 | public List posZ = new List(); 21 | public List negX = new List(); 22 | public List negZ = new List(); 23 | 24 | } 25 | public enum WFC_Socket{Socket_Road, Socket_Curb, Socket_Buildings_Pos, Socket_Buildings_Neg, Socket_FullBuildings} 26 | 27 | [System.Serializable] public class SocketConnection 28 | { 29 | public WFC_Socket socket; 30 | public List validConnections; 31 | } -------------------------------------------------------------------------------- /Scripts/AngelFireObject.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class AngelFireObject : MonoBehaviour 6 | { 7 | public GameObject impactPrefab, beamPrefab; 8 | public float damage = 1f; 9 | public SphereCollider explosionCollider; 10 | private IEnumerator Start() 11 | { 12 | yield return new WaitForSeconds(2f); 13 | impactPrefab.SetActive(true); 14 | beamPrefab.SetActive(false); 15 | explosionCollider.enabled = true; 16 | this.gameObject.transform.parent = null; 17 | Destroy(gameObject, 3f); 18 | } 19 | public GameObject SetUpAngelFire(int damage, float radius) 20 | { 21 | this.damage = damage; 22 | explosionCollider.radius = radius; 23 | return this.gameObject; 24 | } 25 | private void OnTriggerEnter(Collider other) 26 | { 27 | if (other.gameObject.CompareTag("Enemy")) 28 | { 29 | Enemy enemy = other.gameObject.GetComponent(); 30 | enemy.TakeDamage(damage); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Scripts/SpawnBlocker.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SpawnBlocker : MonoBehaviour 6 | { 7 | public Material failMat, succMat; 8 | public bool block; 9 | public Spawner spawner; 10 | private void OnTriggerEnter(Collider other) 11 | { 12 | if(block) 13 | DenySpawn(other); 14 | else 15 | OkForSpawn(other); 16 | } 17 | 18 | private void OnTriggerExit(Collider other) 19 | { 20 | if(block) 21 | OkForSpawn(other); 22 | else 23 | DenySpawn(other); 24 | } 25 | private void OkForSpawn(Collider other) 26 | { 27 | other.GetComponent().material = succMat; 28 | if(!spawner.spawnZones.Contains(other)) 29 | spawner.spawnZones.Add(other); 30 | } 31 | private void DenySpawn(Collider other) 32 | { 33 | other.GetComponent().material = failMat; 34 | if(spawner.spawnZones.Contains(other)) 35 | spawner.spawnZones.Remove(other); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Scripts/Management/PostGameManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using TMPro; 6 | 7 | public class PostGameManager : MonoBehaviour 8 | { 9 | public CanvasGroup postgameCanvasGroup; 10 | public TMP_Text timeSurvivedText, enemiesKilledText, totalScoreText, levelText; 11 | private void Start() 12 | { 13 | RecentGame recentGame = GameManager.instance.saveSystem.GetRecentGame(); 14 | timeSurvivedText.text = $"{recentGame.timeSurvived.ToString("F2")}s"; 15 | enemiesKilledText.text = $"{recentGame.enemiesKilled}"; 16 | 17 | totalScoreText.text = $"{recentGame.rewardAmount}"; 18 | StartCoroutine(postgameCanvasGroup.FadeIn()); 19 | } 20 | public void PlayAgain() 21 | { 22 | GameStateManager.instance.SwitchGameState(GameStateEnum.InGame); 23 | } 24 | public void ReturnToMainMenu() 25 | { 26 | GameStateManager.instance.SwitchGameState(GameStateEnum.MainMenu); 27 | } 28 | public void QuitGame() 29 | { 30 | Application.Quit(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/SFXPlayer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace TJAudio 6 | { 7 | public class SFXPlayer : MonoBehaviour 8 | { 9 | [SerializeField] private SerializableDictionary audioClipsPool = new SerializableDictionary(); 10 | [SerializeField] private AudioSource sFXAudioSource; 11 | 12 | public void PlaySFX(string clipName) 13 | { 14 | AudioClip clipRequested = AudioClipExists(clipName); 15 | 16 | if(clipRequested == null) 17 | { 18 | #if UNITY_EDITOR 19 | Debug.Log($"Clip was not found"); 20 | #endif 21 | return; 22 | } 23 | 24 | sFXAudioSource.PlayOneShot(clipRequested); 25 | } 26 | private AudioClip AudioClipExists(string clipName) 27 | { 28 | AudioClip clipRequested; 29 | if(audioClipsPool.TryGetValue(clipName, out clipRequested)) 30 | return clipRequested; 31 | else 32 | return null; 33 | } 34 | public void SetVolumeLevel(float value) 35 | { 36 | sFXAudioSource.volume = value; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Scripts/SoundSystem/GameEvents.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System; 5 | 6 | public class GameEvents : MonoBehaviour 7 | { 8 | public static GameEvents instance; 9 | private void Awake() 10 | { 11 | if(instance==null) 12 | instance = this; 13 | else 14 | { 15 | Destroy(gameObject); 16 | return; 17 | } 18 | DontDestroyOnLoad(gameObject); 19 | } 20 | 21 | public event Action onButtonClicked, onClearTreesButtonClicked, onProcessWoodClicked; 22 | public event Action onOpenUI; 23 | public void ButtonClicked() 24 | { 25 | if(onButtonClicked!=null) 26 | onButtonClicked(); 27 | } 28 | public void TreesButtonClicked() 29 | { 30 | if(onClearTreesButtonClicked!=null) 31 | onClearTreesButtonClicked(); 32 | } 33 | public void OnOpenUI(bool openUI) 34 | { 35 | if(onOpenUI!=null) 36 | onOpenUI(openUI); 37 | } 38 | public void OnProcessWood() 39 | { 40 | if(onProcessWoodClicked!=null) 41 | onProcessWoodClicked(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Scripts/SteamAchievementManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using TJ_Steamworks; 5 | 6 | public class SteamAchievementManager : MonoBehaviour 7 | { 8 | public static SteamAchievementManager instance; 9 | public UpgradeAchievement[] upgradeAchievements; 10 | private void Awake() 11 | { 12 | if(instance == null) 13 | instance = this; 14 | else 15 | Destroy(this); 16 | } 17 | public void CheckForUpgradeAchievement(Upgrade newUpgrade) 18 | { 19 | foreach(UpgradeAchievement upgradeAchievement in upgradeAchievements) 20 | { 21 | if(upgradeAchievement.upgrade == newUpgrade) 22 | UnlockAchievement(upgradeAchievement.achievement); 23 | } 24 | } 25 | public void UnlockAchievement(SteamAchievement achievement) 26 | { 27 | if(!SteamStatic.IsThisAchievementUnlocked(achievement.achievementId)) 28 | SteamStatic.UnlockAchievement(achievement.achievementId); 29 | } 30 | } 31 | [System.Serializable] public struct UpgradeAchievement 32 | { 33 | public Upgrade upgrade; 34 | public SteamAchievement achievement; 35 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Asset meta data should only be ignored when the corresponding asset is also ignored 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # Autogenerated Jetbrains Rider plugin 20 | [Aa]ssets/Plugins/Editor/JetBrains* 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | 25 | # Gradle cache directory 26 | .gradle/ 27 | 28 | # Autogenerated VS/MD/Consulo solution and project files 29 | ExportedObj/ 30 | .consulo/ 31 | *.csproj 32 | *.unityproj 33 | *.sln 34 | *.suo 35 | *.tmp 36 | *.user 37 | *.userprefs 38 | *.pidb 39 | *.booproj 40 | *.svd 41 | *.pdb 42 | *.mdb 43 | *.opendb 44 | *.VC.db 45 | 46 | # Unity3D generated meta files 47 | *.pidb.meta 48 | *.pdb.meta 49 | *.mdb.meta 50 | 51 | # Unity3D generated file on crash reports 52 | sysinfo.txt 53 | 54 | # Builds 55 | *.apk 56 | *.unitypackage 57 | 58 | # Crashlytics generated file 59 | crashlytics-build.properties 60 | 61 | -------------------------------------------------------------------------------- /Scripts/Entities/Junkie.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class Junkie : Enemy 6 | { 7 | [Header("Junkie Specific")] 8 | [SerializeField] private float range = 2f; 9 | [SerializeField] private Explosion explosionPrefab; 10 | [SerializeField] private float explosionRadius = 2f; 11 | protected override void Start() 12 | { 13 | base.Start(); 14 | InvokeRepeating("CheckForPlayer", 1f, 1f); 15 | } 16 | 17 | private void CheckForPlayer() 18 | { 19 | float distanceAway = Vector3.Distance(transform.position, PlayerManager.instance.transform.position); 20 | 21 | if(distanceAway < range) 22 | { 23 | StartCoroutine(Explode()); 24 | } 25 | } 26 | private IEnumerator Explode() 27 | { 28 | InvokeRepeating("Flash", 0f, flashDuration*1.5f); 29 | enemyMovementOverride = true; 30 | animator.Play("WitnessMe"); 31 | 32 | yield return new WaitForSeconds(0.5f); 33 | Explosion explosion = Instantiate(explosionPrefab, transform.position, Quaternion.identity, null) as Explosion; 34 | Destroy(explosion.gameObject, 3f); 35 | Destroy(gameObject); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Scripts/UI/WeaponUI.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using TMPro; 6 | 7 | public class WeaponUI : MonoBehaviour 8 | { 9 | public Weapon weapon; 10 | public Sprite activeBackground, inactiveBackground, autoFireSprite, manualFireSprite; 11 | public Image weaponIcon, firingModeIcon, lockedIcon; 12 | public TMP_Text weaponText; 13 | public void UnlockUI() 14 | { 15 | lockedIcon.enabled = false; 16 | } 17 | public void LoadWeaponUI(Weapon _weapon) 18 | { 19 | weapon = _weapon; 20 | weapon.weaponUI = this; 21 | weaponIcon.sprite = weapon.icon; 22 | weaponIcon.enabled = true; 23 | firingModeIcon.enabled = true; 24 | 25 | if(weapon.weaponClass != Weapon.WeaponClass.melee) 26 | UpdateAmmo(weapon.MaxAmmoCount); 27 | } 28 | public void UpdateAmmo(int amount) 29 | { 30 | if(weapon!=null) 31 | weaponText.text = amount +"/"+ weapon.MaxAmmoCount.ToString(); 32 | } 33 | public void ToggleFireMode() 34 | { 35 | if(firingModeIcon.sprite==autoFireSprite) 36 | firingModeIcon.sprite = manualFireSprite; 37 | else 38 | firingModeIcon.sprite = autoFireSprite; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Scripts/Map/Cell.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class Cell : MonoBehaviour 6 | { 7 | public bool isCollapsed; 8 | public List possiblePrototypes; 9 | public List prototypeWeights; 10 | public Vector2 coords = new Vector2(); 11 | public Cell posXneighbour; 12 | public Cell negXneighbour; 13 | public Cell posZneighbour; 14 | public Cell negZneighbour; 15 | public MeshFilter meshFilter; 16 | public MeshRenderer meshRenderer; 17 | public void GenerateWeight(Weights weights) 18 | { 19 | prototypeWeights = new List(new int[possiblePrototypes.Count]); 20 | int i = 0; 21 | foreach(Prototype p in possiblePrototypes) 22 | { 23 | if(p.attributes.Count==0) 24 | { 25 | //if no attributes, give it a baseline of 5 26 | prototypeWeights[i] = 5; 27 | } 28 | else 29 | { 30 | //otherwise make its weight the avg of it's attributes 31 | foreach (Attribute attribute in p.attributes) 32 | prototypeWeights[i] += weights.GetWeight(attribute); 33 | 34 | prototypeWeights[i] = (int)((float)prototypeWeights[i]/ (float)p.attributes.Count); 35 | } 36 | i++; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Scripts/SaveData/JSONFileHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using UnityEngine; 6 | 7 | public static class JSONFileHandler 8 | { 9 | public static void SaveToJSON (T toSave, string filename) { 10 | string content = JsonUtility.ToJson (toSave); 11 | // Debug.Log($"GetPath (filename) {GetPath (filename)}"); 12 | WriteFile (GetPath (filename), content); 13 | } 14 | public static T ReadListFromJSON (string filename) { 15 | string content = ReadFile (GetPath (filename)); 16 | 17 | return JsonUtility.FromJson(content); 18 | } 19 | private static string GetPath (string filename) { 20 | return Application.persistentDataPath + "/" + filename; 21 | } 22 | private static void WriteFile (string path, string content) { 23 | FileStream fileStream = new FileStream (path, FileMode.Create); 24 | 25 | using (StreamWriter writer = new StreamWriter (fileStream)) { 26 | writer.Write (content); 27 | } 28 | } 29 | private static string ReadFile (string path) { 30 | if (File.Exists (path)) { 31 | using (StreamReader reader = new StreamReader (path)) { 32 | string content = reader.ReadToEnd (); 33 | return content; 34 | } 35 | } 36 | return ""; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Scripts/IconScreenShotter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | // using TMPro; 6 | 7 | public class IconScreenShotter : MonoBehaviour 8 | { 9 | public bool takeScreenShots; 10 | public GameObject[] itemsToScreenShot; 11 | ScreenshotHandler screenshotHandler; 12 | public void DisplayGameObjects(int i) 13 | { 14 | foreach(GameObject item in itemsToScreenShot) 15 | item.SetActive(false); 16 | 17 | itemsToScreenShot[i].SetActive(true); 18 | } 19 | private void Start() 20 | { 21 | screenshotHandler = GetComponent(); 22 | // #if UNITY_EDITOR 23 | // EditorUtility.SetDirty(scriptableObject); 24 | // #endif 25 | if(takeScreenShots) 26 | StartCoroutine(GenerateScreenShots()); 27 | 28 | // AssetDatabase.SaveAssets(); 29 | } 30 | public IEnumerator GenerateScreenShots() 31 | { 32 | yield return new WaitForSeconds(1f); 33 | 34 | int i = 0; 35 | while (i < itemsToScreenShot.Length) 36 | { 37 | DisplayGameObjects(i); 38 | yield return new WaitForSeconds(.25f); 39 | 40 | screenshotHandler.TakeScreenshot(512,512, itemsToScreenShot[i].name); 41 | i++; 42 | 43 | yield return new WaitForSeconds(.25f); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Scripts/RewardsManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class RewardsManager : MonoBehaviour 6 | { 7 | public static RewardsManager instance; 8 | private void Awake() 9 | { 10 | if (instance == null) 11 | { 12 | instance = this; 13 | } 14 | else 15 | { 16 | Destroy(gameObject); 17 | } 18 | } 19 | 20 | public float CalculateRewardAmount(float secondsSurvived) 21 | { 22 | float rewardAmount = Mathf.Lerp(0f, 500, Mathf.Pow(secondsSurvived, 2) / Mathf.Pow(600, 2)); 23 | if(secondsSurvived > 600 ) 24 | rewardAmount += (secondsSurvived-600)*5f; 25 | 26 | // Debug.Log($"Seconds Survived: {secondsSurvived}, Reward Amount: {rewardAmount}"); 27 | return rewardAmount; 28 | } 29 | [ContextMenu("Test Calculate Reward Amount")] 30 | public void TestCalculateRewardAmount() 31 | { 32 | Debug.Log($"Reward Amount at 1 minute survived: {CalculateRewardAmount(60)}"); 33 | Debug.Log($"Reward Amount at 5 minute survived: {CalculateRewardAmount(300)}"); 34 | Debug.Log($"Reward Amount at 10 minutes survived: {CalculateRewardAmount(600)}"); 35 | Debug.Log($"Reward Amount at 15 minutes survived: {CalculateRewardAmount(900)}"); 36 | Debug.Log($"Reward Amount at 20 minutes survived: {CalculateRewardAmount(1200)}"); 37 | Debug.Log($"Reward Amount at 25 minutes survived: {CalculateRewardAmount(1500)}"); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Scripts/AngelFire.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class AngelFire : MonoBehaviour 6 | { 7 | [SerializeField] float angelFireDamage = 1f; 8 | [SerializeField] GameObject angelFirePrefab; 9 | public bool angelFireActive = false; 10 | public IEnumerator ActivateAngelFire() 11 | { 12 | angelFireActive = true; 13 | PlayerManager.instance.uIManager.RechargeCyberUpgradeUI(CyberwareType.AngelFire); 14 | 15 | Enemy highestHealthEnemy = GetEnemyWithHighestHealth(); 16 | if(highestHealthEnemy==null) 17 | yield break; 18 | 19 | Debug.Log($"Highest health enemy is {highestHealthEnemy.name}"); 20 | AngelFireObject angelFireObject = Instantiate(angelFirePrefab, highestHealthEnemy.transform.position, Quaternion.identity, highestHealthEnemy.transform).GetComponent(); 21 | GameObject angelFireLoaded = angelFireObject.SetUpAngelFire((int)angelFireDamage, 2f); 22 | while(angelFireLoaded!=null) 23 | yield return null; 24 | 25 | angelFireActive = false; 26 | } 27 | public Enemy GetEnemyWithHighestHealth() 28 | { 29 | Enemy[] enemies = FindObjectsOfType(); 30 | Enemy highestHealthEnemy = null; 31 | for (int i = 0; i < enemies.Length; i++) 32 | { 33 | if(highestHealthEnemy==null || enemies[i].Health > highestHealthEnemy.Health) 34 | highestHealthEnemy = enemies[i]; 35 | } 36 | return highestHealthEnemy; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Scripts/UI/PlayerUI.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using TMPro; 6 | 7 | public class PlayerUI : MonoBehaviour 8 | { 9 | public Slider healthBar, expBar, reloadBar; 10 | public TMP_Text expLevelNumber; 11 | public Transform upgradeBarTarget; 12 | PlayerStats playerStats; 13 | UpgradeManager upgradeManager; 14 | private void Start() 15 | { 16 | upgradeBarTarget = PlayerManager.instance.transform; 17 | playerStats = PlayerManager.instance.playerStats; 18 | upgradeManager = PlayerManager.instance.upgradeManager; 19 | 20 | healthBar.value = PlayerManager.instance.Health; 21 | UpdateExpBar(); 22 | } 23 | private void Update() 24 | { 25 | ShowOnUI(upgradeBarTarget); 26 | healthBar.value = PlayerManager.instance.Health; 27 | healthBar.maxValue = PlayerManager.instance.startingHealth * playerStats.BonusHealth/100; 28 | } 29 | public void ShowOnUI(Transform target) 30 | { 31 | if(target==null) 32 | return; 33 | 34 | Vector3 pos = Camera.main.WorldToScreenPoint(target.position); 35 | this.transform.position = pos; 36 | } 37 | public void DisplayExp() 38 | { 39 | expBar.value = playerStats.Exp; 40 | } 41 | public void UpdateExpBar() 42 | { 43 | expLevelNumber.text = playerStats.expLevel.levelNumber.ToString(); 44 | expBar.minValue = playerStats.expLevel.minExp; 45 | expBar.maxValue = playerStats.expLevel.maxExp; 46 | expBar.value = playerStats.Exp; 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /Scripts/WeaponManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class WeaponManager : MonoBehaviour 6 | { 7 | public static WeaponManager instance; 8 | [SerializeField] private List weaponsUIs = new List(); 9 | [SerializeField] private List possibleWeapons; 10 | public Dictionary> weaponDictionary = new Dictionary>(); 11 | 12 | private void Awake() 13 | { 14 | if (instance == null) 15 | instance = this; 16 | else 17 | Destroy(this); 18 | 19 | foreach (BaseWeaponStats item in possibleWeapons) 20 | weaponDictionary.Add(item.weaponType, item.weaponLevels); 21 | 22 | possibleWeapons = null; 23 | } 24 | public void LoadWeaponUI(Weapon weaponToEquip) 25 | { 26 | weaponsUIs[PlayerManager.instance.weaponController.WeaponCount-1].LoadWeaponUI(weaponToEquip); 27 | } 28 | public void LoadWeaponsUnlocked() 29 | { 30 | for (int i = 0; i < PlayerManager.instance.playerStats.WeaponSlots; i++) 31 | { 32 | weaponsUIs[i].UnlockUI(); 33 | } 34 | } 35 | } 36 | 37 | 38 | [System.Serializable] public struct BaseWeaponStats 39 | { 40 | public WeaponType weaponType; 41 | public List weaponLevels; 42 | } 43 | [System.Serializable] public struct WeaponLevel 44 | { 45 | public float gunRateOfFire; 46 | public float muzzleVelocity; 47 | public int projectilePiercing; 48 | public float projectileVariance; 49 | public float damage; 50 | public float reloadSpeed; 51 | public float maxAmmoCount; 52 | } 53 | -------------------------------------------------------------------------------- /Scripts/Player/CyberwareManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class CyberwareManager : MonoBehaviour 6 | { 7 | public List cyberwareUpgrades = new List(); 8 | Sandevistan sandevistan; 9 | AngelFire angelFire; 10 | public GameObject dronePrefab; 11 | private void Awake() 12 | { 13 | sandevistan = GetComponent(); 14 | angelFire = GetComponent(); 15 | } 16 | public void LoadCyberware(CyberwareUpgrade cyberware) 17 | { 18 | cyberwareUpgrades.Add(cyberware); 19 | 20 | if(cyberware.cyberwareType == CyberwareType.Drone) 21 | Instantiate(dronePrefab, transform.position, Quaternion.identity, null); 22 | } 23 | private void Update() 24 | { 25 | FireAutoCyberware(); 26 | } 27 | private void FireAutoCyberware() 28 | { 29 | if(PlayerManager.instance.upgradeManager.AngelFireOnline() && !angelFire.angelFireActive) 30 | StartCoroutine(angelFire.ActivateAngelFire()); 31 | } 32 | public void HandleCyberware(int cyberwareIndex) 33 | { 34 | if(cyberwareIndex > cyberwareUpgrades.Count) 35 | { 36 | Debug.Log($"Cyberware index {cyberwareIndex} is out of range"); 37 | return; 38 | } 39 | 40 | if(cyberwareUpgrades[cyberwareIndex-1].cyberwareType == CyberwareType.Sandevistan) 41 | HandleSandevistan(); 42 | } 43 | private void HandleSandevistan() 44 | { 45 | if(PlayerManager.instance.upgradeManager.SandevistanOnline() && 46 | !sandevistan.sandevistanActive && 47 | !sandevistan.OnCoolDown) 48 | StartCoroutine(sandevistan.ActivateSandy()); 49 | } 50 | public void OverrideSandy() 51 | { 52 | if( 53 | !sandevistan.sandevistanActive && 54 | !sandevistan.OnCoolDown) 55 | StartCoroutine(sandevistan.ActivateSandy()); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Scripts/UI/UpgradeUI.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using TMPro; 6 | 7 | public class UpgradeUI : MonoBehaviour 8 | { 9 | [SerializeField] private RenderTexture upgradeRender; 10 | [SerializeField] private RawImage rawImage; 11 | [SerializeField] private Upgrade upgrade; 12 | [SerializeField] private TMP_Text upgradeNameText, upgradeDescription, levelText; 13 | [SerializeField] private UpgradeRenders upgradeRenders; 14 | 15 | public void LoadUpgradeUI(Upgrade _upgrade) 16 | { 17 | upgrade = _upgrade; 18 | upgradeRenders.LoadUpgrade(upgrade); 19 | rawImage.texture = upgradeRender; 20 | 21 | // upgradeImage.sprite = upgrade.upgradeIcon; 22 | upgradeNameText.text = upgrade.upgradeName; 23 | int upgradeLevel = PlayerManager.instance.GetUpgradeLevel(upgrade); 24 | 25 | if(upgrade.upgradlevels!=null && upgrade.upgradlevels.Length>0) 26 | { 27 | string modificationAmount = upgrade.upgradlevels[upgradeLevel].upgradeModifier.ToString(); 28 | 29 | if(upgrade.upgradlevels[upgradeLevel].upgradeModifier>=100) 30 | modificationAmount += "%"; 31 | 32 | if(upgrade.upgradeDescription.Contains("{stat}")) 33 | { 34 | upgradeDescription.text = upgrade.upgradeDescription.Replace("{stat}", modificationAmount); 35 | } 36 | else 37 | { 38 | upgradeDescription.text = upgrade.upgradeDescription; 39 | } 40 | levelText.text = "Level "+ upgradeLevel.ToString() + "/" + upgrade.upgradlevels.Length.ToString(); 41 | } 42 | else // for cyberware 43 | { 44 | levelText.text = ""; 45 | upgradeDescription.text = upgrade.upgradeDescription; 46 | } 47 | 48 | 49 | } 50 | public void AcquireUpgrade() 51 | { 52 | PlayerManager.instance.AcquireUpgrade(upgrade); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Scripts/Entities/Opperator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class Opperator : Enemy 6 | { 7 | [Header("Opperator Specific")] 8 | [SerializeField] private float muzzleVelocity = 2f; 9 | [SerializeField] private Projectile projectile; 10 | [SerializeField] private float range = 10f; 11 | 12 | [Header("Weapon")] 13 | private Coroutine flashOnHit; 14 | private WaitForSeconds flashWait; 15 | [SerializeField] private Light muzzzleFlash; 16 | protected override void Start() 17 | { 18 | base.Start(); 19 | InvokeRepeating("Fire", 5f, 5f); 20 | } 21 | 22 | private void Fire() 23 | { 24 | StartCoroutine(FirePause()); 25 | } 26 | private IEnumerator FirePause() 27 | { 28 | if(Vector3.Distance(transform.position, PlayerManager.instance.transform.position) > range) 29 | yield break; 30 | 31 | enemyMovementOverride = true; 32 | animator.Play("fireRifle"); 33 | yield return new WaitForSeconds(1f); 34 | enemyMovementOverride = false; 35 | MuzzleFlash(); 36 | 37 | // float offset = Random.Range(-projectileVariance, projectileVariance); 38 | this.transform.LookAt(PlayerManager.instance.transform.position); 39 | Quaternion newrotation = this.transform.rotation; 40 | newrotation *= Quaternion.Euler(0, 0, 0); 41 | Projectile newProjectile = Instantiate(projectile,this.transform.position+Vector3.up, newrotation) as Projectile; 42 | 43 | newProjectile.SetStats(muzzleVelocity, damage, 1, 0, 1); 44 | } 45 | public void MuzzleFlash() 46 | { 47 | if(flashOnHit!=null) 48 | StopCoroutine(flashOnHit); 49 | 50 | flashOnHit = StartCoroutine(MuzzleFlashRoutine()); 51 | } 52 | public IEnumerator MuzzleFlashRoutine() 53 | { 54 | muzzzleFlash.enabled = true; 55 | yield return flashWait; 56 | muzzzleFlash.enabled = false; 57 | flashOnHit = null; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/IAudioRequester.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using TJAudio; 5 | namespace TJAudio 6 | { 7 | public class IAudioRequester : MonoBehaviour 8 | { 9 | public static IAudioRequester instance; 10 | [SerializeField] private FixedBGMPlayer fixedBGMPlayer; 11 | [SerializeField] private DynamicBGMPlayer dynamicBGMPlayer; 12 | [SerializeField] public AmbiencePlayer ambiencePlayer; 13 | [SerializeField] private SFXPlayer sFXPlayer; 14 | private void Awake() 15 | { 16 | if(instance==null) 17 | instance = this; 18 | else 19 | { 20 | Destroy(gameObject); 21 | return; 22 | } 23 | DontDestroyOnLoad(gameObject); 24 | } 25 | private void Start() 26 | { 27 | GameEvents.instance.onButtonClicked += OnButtonClicked; 28 | GameEvents.instance.onClearTreesButtonClicked += OnClearTreesButtonClicked; 29 | GameEvents.instance.onOpenUI += OnOpenUI; 30 | GameEvents.instance.onProcessWoodClicked += OnProcessWood; 31 | } 32 | private void OnButtonClicked() 33 | { 34 | instance.PlaySFX("mouseClick"); 35 | } 36 | private void OnClearTreesButtonClicked() 37 | { 38 | instance.PlaySFX("startBuild"); 39 | } 40 | private void OnProcessWood() 41 | { 42 | instance.PlaySFX("startBuild"); 43 | } 44 | private void OnOpenUI(bool openUI) 45 | { 46 | if(openUI) 47 | instance.PlaySFX("openUI"); 48 | else 49 | instance.PlaySFX("closeUI"); 50 | } 51 | public void PlaySFX(string clipName) 52 | { 53 | sFXPlayer.PlaySFX(clipName); 54 | } 55 | public void SetBGMVolumeLevel(float value) 56 | { 57 | fixedBGMPlayer.SetVolumeLevel(value); 58 | } 59 | public void SetSFXVolumeLevel(float value) 60 | { 61 | sFXPlayer.SetVolumeLevel(value); 62 | } 63 | public static void PlaySFX_Static(string clipName) 64 | { 65 | instance.PlaySFX(clipName); 66 | } 67 | } 68 | public struct AudioClipID 69 | { 70 | public string id; 71 | public AudioClip audioClip; 72 | } 73 | } 74 | 75 | -------------------------------------------------------------------------------- /Scripts/MainMenu.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class MainMenu : MonoBehaviour 6 | { 7 | [SerializeField] private CanvasGroup main, options, sound, video, controls, ripperDoc; 8 | [SerializeField] private GameObject ripperDocPrefab, gunShopPrefab; 9 | public void PlayGame() 10 | { 11 | GameStateManager.instance.SwitchGameState(GameStateEnum.InGame); 12 | } 13 | public void Options() 14 | { 15 | main.Disable(); 16 | options.Enable(); 17 | } 18 | public void ReturnToMain() 19 | { 20 | options.Disable(); 21 | main.Enable(); 22 | } 23 | public void OpenSound() 24 | { 25 | options.Disable(); 26 | sound.Enable(); 27 | } 28 | public void OpenVideo() 29 | { 30 | options.Disable(); 31 | video.Enable(); 32 | } 33 | public void OpenControls() 34 | { 35 | options.Disable(); 36 | controls.Enable(); 37 | } 38 | public void OpenRipperDoc() 39 | { 40 | StartCoroutine(RipperDocTransition(true)); 41 | } 42 | public void BackToGunShop() 43 | { 44 | ripperDoc.Disable(); 45 | StartCoroutine(RipperDocTransition(false)); 46 | } 47 | public IEnumerator RipperDocTransition(bool toRipperDoc) 48 | { 49 | GameStateManager.instance.QuickFadeIn(); 50 | 51 | yield return GameStateManager.instance.pauseLength; 52 | 53 | ripperDocPrefab.SetActive(toRipperDoc); 54 | gunShopPrefab.SetActive(!toRipperDoc); 55 | 56 | GameStateManager.instance.QuickFadeOut(); 57 | if(!toRipperDoc) 58 | ReturnToMain(); 59 | else 60 | { 61 | ripperDoc.Enable(); 62 | main.Disable(); 63 | } 64 | } 65 | public void ReturnToOptions() 66 | { 67 | video.Disable(); 68 | sound.Disable(); 69 | controls.Disable(); 70 | ripperDoc.Disable(); 71 | options.Enable(); 72 | } 73 | public void Quit() 74 | { 75 | #if UNITY_STANDALONE 76 | Application.Quit(); 77 | #endif 78 | #if UNITY_EDITOR 79 | UnityEditor.EditorApplication.isPlaying = false; 80 | #endif 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Scripts/SaveData/MetaProgressionManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class MetaProgressionManager : MonoBehaviour 6 | { 7 | public List metaProgressionContainers; 8 | public List playerBaseStats; 9 | public List LoadMetaProgression() 10 | { 11 | metaProgressionContainers = GameManager.instance.saveSystem.GetMetaProgression(); 12 | return metaProgressionContainers; 13 | } 14 | public void UnlockMetaProgression(MetaProgressionSO metaProgressionSO) 15 | { 16 | for (int i = 0; i < metaProgressionContainers.Count; i++) 17 | { 18 | if(metaProgressionContainers[i].metaProgressionSO == metaProgressionSO) 19 | { 20 | for (int j = 0; j < metaProgressionContainers[i].metaLevels.Count; j++) 21 | { 22 | if (!metaProgressionContainers[i].metaLevels[j].unlocked) 23 | { 24 | metaProgressionContainers[i].metaLevels[j].unlocked = true; 25 | break; 26 | } 27 | } 28 | break; 29 | } 30 | } 31 | SaveMetaProgression(); 32 | } 33 | public void SaveMetaProgression() 34 | { 35 | GameManager.instance.saveSystem.SaveMetaProgression(); 36 | Debug.Log($"Saved Meta Progression"); 37 | } 38 | } 39 | [System.Serializable] public class MetaProgressionContainer 40 | { 41 | public MetaProgressionSO metaProgressionSO; 42 | public List metaLevels; 43 | public float GetHighestUnlockedLevel(MetaProgressionSO metaProgressionSO) 44 | { 45 | float highestLevel = GameManager.instance.metaProgressionManager.playerBaseStats.Find(x => x.metaProgressionSO == metaProgressionSO).baseValue; 46 | for (int i = 0; i < metaLevels.Count; i++) 47 | { 48 | if (metaLevels[i].unlocked) 49 | { 50 | highestLevel = metaLevels[i].modificaitonAmount; 51 | } 52 | } 53 | if(highestLevel>=100) 54 | return highestLevel/100; 55 | 56 | return highestLevel; 57 | } 58 | } 59 | [System.Serializable] public class MetaLevel 60 | { 61 | public int level; 62 | public float cost; 63 | public float modificaitonAmount; 64 | public bool unlocked; 65 | } 66 | [System.Serializable] public class PlayerBaseStats 67 | { 68 | public MetaProgressionSO metaProgressionSO; 69 | public float baseValue; 70 | } 71 | -------------------------------------------------------------------------------- /Scripts/Entities/MechBoss.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class MechBoss : Enemy 6 | { 7 | [Header("MechBoss Specific")] 8 | [SerializeField] private float muzzleVelocity = 2f; 9 | [SerializeField] private Projectile projectile; 10 | [SerializeField] private float range = 10f; 11 | [SerializeField] private Transform projectileSpawnPoint; 12 | 13 | [Header("Weapon")] 14 | private Coroutine flashOnHit; 15 | private WaitForSeconds flashWait; 16 | [SerializeField] private Light muzzzleFlash; 17 | [SerializeField] private float rateOfFire = 0.2f, roundsToFire = 10f; 18 | bool lookAtPlayer = false; 19 | protected override void Start() 20 | { 21 | base.Start(); 22 | InvokeRepeating("Fire", 5f, 10f); 23 | } 24 | 25 | private void Fire() 26 | { 27 | StartCoroutine(FirePause()); 28 | } 29 | private IEnumerator FirePause() 30 | { 31 | enemyMovementOverride = true; 32 | float amountToFire = roundsToFire; 33 | animator.SetBool("isFiring", true); 34 | lookAtPlayer = true; 35 | StartCoroutine(LookAtPlayer()); 36 | 37 | yield return new WaitForSeconds(1f); 38 | 39 | while(amountToFire>0) 40 | { 41 | MuzzleFlash(); 42 | projectileSpawnPoint.LookAt(new Vector3(PlayerManager.instance.transform.position.x, 1f, PlayerManager.instance.transform.position.z)); 43 | Quaternion newrotation = projectileSpawnPoint.rotation; 44 | Projectile newProjectile = Instantiate(projectile, projectileSpawnPoint.position, newrotation) as Projectile; 45 | amountToFire--; 46 | newProjectile.SetStats(muzzleVelocity, damage, 1, 0, 1); 47 | yield return new WaitForSeconds(rateOfFire); 48 | } 49 | 50 | enemyMovementOverride = false; 51 | animator.SetBool("isFiring", false); 52 | lookAtPlayer = false; 53 | } 54 | private IEnumerator LookAtPlayer() 55 | { 56 | while(lookAtPlayer) 57 | { 58 | Vector3 lookPos = new Vector3(PlayerManager.instance.transform.position.x, this.transform.position.y, PlayerManager.instance.transform.position.z); 59 | this.transform.LookAt(lookPos); 60 | yield return null; 61 | } 62 | } 63 | public void MuzzleFlash() 64 | { 65 | if(flashOnHit!=null) 66 | StopCoroutine(flashOnHit); 67 | 68 | flashOnHit = StartCoroutine(MuzzleFlashRoutine()); 69 | } 70 | public IEnumerator MuzzleFlashRoutine() 71 | { 72 | muzzzleFlash.enabled = true; 73 | yield return flashWait; 74 | muzzzleFlash.enabled = false; 75 | flashOnHit = null; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Scripts/Drone.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class Drone : MonoBehaviour 6 | { 7 | public Enemy target; 8 | public float rotationSpeed = 10f, droneRateOfFire = 0.5f, nextShotTime = 0f, damage = 10f, 9 | moveSpeed = 5f, projectileVariance = 5f, projectilePiercing = 1f, muzzleVelocity = 100f, flashWait = 0.02f; 10 | public Projectile projectilePrefab; 11 | public Transform droneFireSpot, drone; 12 | public Light droneMuzzleFlash; 13 | private Coroutine flashOnHit; 14 | Quaternion lookRotation; 15 | void Update() 16 | { 17 | if(target == null) 18 | { 19 | FindTarget(); 20 | return; 21 | } 22 | 23 | FaceNearestEnemy(); 24 | Fire(); 25 | } 26 | private void FixedUpdate() 27 | { 28 | MoveToPlayer(); 29 | } 30 | void FindTarget() 31 | { 32 | Enemy[] enemies = FindObjectsOfType(); 33 | float minDistance = Mathf.Infinity; 34 | foreach (Enemy enemy in enemies) 35 | { 36 | float distance = Vector3.Distance(transform.position, enemy.transform.position); 37 | if (distance < minDistance) 38 | { 39 | minDistance = distance; 40 | target = enemy; 41 | } 42 | } 43 | } 44 | void FaceNearestEnemy() 45 | { 46 | Vector3 direction = (target.transform.position - drone.position).normalized; 47 | lookRotation = Quaternion.LookRotation(new Vector3(direction.x, 0, direction.z)); 48 | drone.rotation = Quaternion.Slerp(drone.rotation, lookRotation, Time.deltaTime * rotationSpeed); 49 | } 50 | void MoveToPlayer() 51 | { 52 | this.transform.position = Vector3.Lerp(this.transform.position, PlayerManager.instance.transform.position, Time.deltaTime * moveSpeed); 53 | } 54 | void Fire() 55 | { 56 | if(Time.time > nextShotTime) 57 | { 58 | nextShotTime = Time.time + (droneRateOfFire / PlayerManager.instance.playerStats.RateOfFire); 59 | 60 | MuzzleFlash(); 61 | 62 | float offset = Random.Range(-projectileVariance, projectileVariance); 63 | Projectile newProjectile = Instantiate(projectilePrefab, droneFireSpot.position, lookRotation) as Projectile; 64 | 65 | newProjectile.SetStats(muzzleVelocity, damage, (int)projectilePiercing, 0, 1); 66 | } 67 | } 68 | public IEnumerator FlashOnHit() 69 | { 70 | droneMuzzleFlash.enabled = true; 71 | yield return flashWait; 72 | droneMuzzleFlash.enabled = false; 73 | flashOnHit = null; 74 | } 75 | public void MuzzleFlash() 76 | { 77 | if(flashOnHit!=null) 78 | StopCoroutine(flashOnHit); 79 | 80 | flashOnHit = StartCoroutine(FlashOnHit()); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Scripts/SoundSystem/DynamicBGMPlayer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System; 5 | 6 | namespace TJAudio 7 | { 8 | public class DynamicBGMPlayer : MonoBehaviour 9 | { 10 | [Range(0f,1f)] [SerializeField] private float musicScale; 11 | [Range(0f,1f)] [SerializeField] private float effectScale; 12 | 13 | [SerializeField] private float musicVolume, transitionTime; 14 | [SerializeField] private AudioSource audioSourceA, audioSourceB; 15 | [SerializeField] private bool musicSwichInProgress; 16 | [SerializeField] private SerializableDictionary audioClipsPool = new SerializableDictionary(); 17 | 18 | public void SwitchBGM(string clipName) 19 | { 20 | AudioClip clipRequested = AudioClipExists(clipName); 21 | 22 | if(clipRequested == null) 23 | { 24 | #if UNITY_EDITOR 25 | Debug.Log($"Clip was not found"); 26 | #endif 27 | return; 28 | } 29 | 30 | if(musicSwichInProgress) 31 | { 32 | //need to add some sort of quick fade thing if we try to swap before it has been completed, not sure how yet 33 | } 34 | 35 | musicSwichInProgress = true; 36 | 37 | if(audioSourceA.isPlaying) 38 | { 39 | audioSourceB.clip = clipRequested; 40 | StartCoroutine(FadeAudio(audioSourceA, audioSourceA.volume, 0, transitionTime)); 41 | StartCoroutine(FadeAudio(audioSourceB, audioSourceB.volume, musicVolume, transitionTime)); 42 | } 43 | else 44 | { 45 | audioSourceB.clip = clipRequested; 46 | StartCoroutine(FadeAudio(audioSourceB, audioSourceB.volume, 0, transitionTime)); 47 | StartCoroutine(FadeAudio(audioSourceA, audioSourceA.volume, musicVolume, transitionTime)); 48 | } 49 | 50 | Invoke("CompleteTransition", transitionTime); 51 | } 52 | private IEnumerator FadeAudio(AudioSource audioSource, float startValue, float endValue, float fadeDuration) 53 | { 54 | if(audioSource.volume == 0) 55 | audioSource.Play(); 56 | 57 | float currentLerpTime = 0f, lerpValue = 0f; 58 | 59 | while (audioSource.volume != endValue) 60 | { 61 | currentLerpTime += Time.deltaTime; 62 | 63 | if (currentLerpTime < fadeDuration) 64 | { 65 | lerpValue = Mathf.Lerp(startValue, endValue, currentLerpTime / fadeDuration); 66 | } 67 | else 68 | { 69 | lerpValue = endValue; 70 | } 71 | 72 | audioSource.volume= lerpValue; 73 | yield return null; 74 | } 75 | 76 | if(audioSource.volume == 0) 77 | audioSource.Pause(); 78 | } 79 | private void CompleteTransition() 80 | { 81 | musicSwichInProgress = false; 82 | } 83 | private AudioClip AudioClipExists(string clipName) 84 | { 85 | return audioClipsPool.TryGetValue(clipName, out var clipRequested) ? clipRequested : default; 86 | } 87 | } 88 | } -------------------------------------------------------------------------------- /Scripts/ExtensionMethods.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | //It is common to create a class to contain all of your 5 | //extension methods. This class must be static. 6 | public static class ExtensionMethods 7 | { 8 | //Even though they are used like normal methods, extension 9 | //methods must be declared static. Notice that the first 10 | //parameter has the 'this' keyword followed by a Transform 11 | //variable. This variable denotes which class the extension 12 | //method becomes a part of. 13 | public static void ResetTransformation(this Transform trans) 14 | { 15 | trans.position = Vector3.zero; 16 | trans.localRotation = Quaternion.identity; 17 | trans.localScale = new Vector3(1, 1, 1); 18 | } 19 | public static IEnumerator FadeIn(this CanvasGroup canvasGroup, float duration = 0.5f) 20 | { 21 | canvasGroup.interactable = false; 22 | canvasGroup.blocksRaycasts = false; 23 | canvasGroup.alpha = 0; 24 | float startTime = Time.time; 25 | 26 | float t = 0.0f; 27 | while (canvasGroup.alpha < 1) 28 | { 29 | t = (Time.time-startTime) / duration; 30 | canvasGroup.alpha = t; 31 | yield return null; 32 | } 33 | 34 | canvasGroup.interactable = true; 35 | canvasGroup.blocksRaycasts = true; 36 | canvasGroup.alpha = 1; 37 | } 38 | public static IEnumerator FadeOut(this CanvasGroup canvasGroup, float duration = 0.5f) 39 | { 40 | canvasGroup.interactable = true; 41 | canvasGroup.blocksRaycasts = true; 42 | canvasGroup.alpha = 1; 43 | float startTime = Time.time; 44 | 45 | float t = 0.0f; 46 | while (canvasGroup.alpha > 0) 47 | { 48 | t = (Time.time-startTime) / duration; 49 | canvasGroup.alpha = 1 - t; 50 | yield return null; 51 | } 52 | 53 | canvasGroup.interactable = false; 54 | canvasGroup.blocksRaycasts = false; 55 | canvasGroup.alpha = 0; 56 | } 57 | public static void Enable(this CanvasGroup canvasGroup) 58 | { 59 | canvasGroup.interactable = true; 60 | canvasGroup.blocksRaycasts = true; 61 | canvasGroup.alpha = 1; 62 | } 63 | public static void Disable(this CanvasGroup canvasGroup) 64 | { 65 | canvasGroup.interactable = false; 66 | canvasGroup.blocksRaycasts = false; 67 | canvasGroup.alpha = 0; 68 | } 69 | public static T GetClosestObject(Vector3 currentPosition, T[] objects, T objectToAvoid = null) where T : Component 70 | { 71 | T closestT = null; 72 | float minDist = Mathf.Infinity; 73 | foreach (T obj in objects) 74 | { 75 | if(obj==objectToAvoid) 76 | continue; 77 | 78 | float dist = Vector3.Distance(obj.gameObject.transform.position, currentPosition); 79 | 80 | if (dist < minDist) 81 | { 82 | closestT = obj; 83 | minDist = dist; 84 | } 85 | } 86 | return closestT; 87 | } 88 | } -------------------------------------------------------------------------------- /Scripts/SoundSystem/AmbiencePlayer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System; 5 | 6 | namespace TJAudio 7 | { 8 | public class AmbiencePlayer : MonoBehaviour 9 | { 10 | [SerializeField] private AudioClip[] audioClipsPool; 11 | [SerializeField] private int timeIntervalToSelectClips = 5; 12 | [SerializeField] private List audioSources = new List(); 13 | private List freedAudioSources = new List(); 14 | [SerializeField] private GameObject audioSourcePrefab; 15 | [SerializeField] private int maxAmountOfAudioSources = 5; 16 | [SerializeField] private bool turnOff; 17 | private float timer; 18 | public event Action OnAudioEndPlaying; 19 | 20 | public void TurnOff(bool stopAllAudioSources) 21 | { 22 | //prevent playing new audio 23 | turnOff = true; 24 | 25 | //stop playing all audio 26 | if(stopAllAudioSources) 27 | CancelInvoke("PlayAmbiantClip"); 28 | } 29 | public void OnAudioSourcePlayingHandler() 30 | { 31 | if(OnAudioEndPlaying!=null) 32 | OnAudioEndPlaying(); 33 | } 34 | public void OnAudioSourceFreedHandler(AudioSource audioSource) 35 | { 36 | freedAudioSources.Add(audioSource); 37 | } 38 | private void FixedUpdate() 39 | { 40 | if(turnOff) 41 | return; 42 | 43 | timer += Time.deltaTime; 44 | 45 | if(timer >= timeIntervalToSelectClips) 46 | { 47 | timer = 0; 48 | PlayAmbiantClip(); 49 | } 50 | } 51 | public void PlayAmbiantClip() 52 | { 53 | AudioSource freeAudioSource = GetFreeAudioSource(); 54 | if(freeAudioSource == null) 55 | freeAudioSource = AddAudioSource(); 56 | 57 | if(freeAudioSource == null) 58 | { 59 | //no free audio source available and max amount of audio sources reached 60 | return; 61 | } 62 | 63 | freeAudioSource.clip = SelectRandomAudioClip(); 64 | freeAudioSource.Play(); 65 | // Debug.Log($"Playing {freeAudioSource.clip.name} on {freeAudioSource.gameObject.name}"); 66 | } 67 | private AudioSource AddAudioSource() 68 | { 69 | if(audioSources.Count >= maxAmountOfAudioSources) 70 | { 71 | #if UNITY_EDITOR 72 | // Debug.Log("Max amount of audio sources reached"); 73 | #endif 74 | 75 | return null; 76 | } 77 | 78 | GameObject newAudioSource = Instantiate(audioSourcePrefab, transform); 79 | AudioSource newAudioSourceComponent = newAudioSource.GetComponent(); 80 | audioSources.Add(newAudioSourceComponent); 81 | return newAudioSourceComponent; 82 | } 83 | private AudioClip SelectRandomAudioClip() 84 | { 85 | return audioClipsPool[UnityEngine.Random.Range(0, audioClipsPool.Length)]; 86 | } 87 | private AudioSource GetFreeAudioSource() 88 | { 89 | for(int i = 0; i < freedAudioSources.Count;) 90 | { 91 | AudioSource freeAudioSource = freedAudioSources[i]; 92 | freedAudioSources.RemoveAt(i); 93 | return freeAudioSource; 94 | } 95 | return null; 96 | } 97 | } 98 | } -------------------------------------------------------------------------------- /Scripts/SoundSystem/AmbientAudioSource.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &6682474810795130509 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: 6682474810795130508} 12 | - component: {fileID: 6682474810795130511} 13 | - component: {fileID: 223430405410468773} 14 | m_Layer: 0 15 | m_Name: AmbientAudioSource 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &6682474810795130508 22 | Transform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 6682474810795130509} 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0, z: 0} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_ConstrainProportionsScale: 0 32 | m_Children: [] 33 | m_Father: {fileID: 0} 34 | m_RootOrder: 0 35 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 36 | --- !u!82 &6682474810795130511 37 | AudioSource: 38 | m_ObjectHideFlags: 0 39 | m_CorrespondingSourceObject: {fileID: 0} 40 | m_PrefabInstance: {fileID: 0} 41 | m_PrefabAsset: {fileID: 0} 42 | m_GameObject: {fileID: 6682474810795130509} 43 | m_Enabled: 1 44 | serializedVersion: 4 45 | OutputAudioMixerGroup: {fileID: 0} 46 | m_audioClip: {fileID: 0} 47 | m_PlayOnAwake: 1 48 | m_Volume: 0.24 49 | m_Pitch: 1 50 | Loop: 0 51 | Mute: 0 52 | Spatialize: 0 53 | SpatializePostEffects: 0 54 | Priority: 128 55 | DopplerLevel: 1 56 | MinDistance: 1 57 | MaxDistance: 500 58 | Pan2D: 0 59 | rolloffMode: 0 60 | BypassEffects: 0 61 | BypassListenerEffects: 0 62 | BypassReverbZones: 0 63 | rolloffCustomCurve: 64 | serializedVersion: 2 65 | m_Curve: 66 | - serializedVersion: 3 67 | time: 0 68 | value: 1 69 | inSlope: 0 70 | outSlope: 0 71 | tangentMode: 0 72 | weightedMode: 0 73 | inWeight: 0.33333334 74 | outWeight: 0.33333334 75 | - serializedVersion: 3 76 | time: 1 77 | value: 0 78 | inSlope: 0 79 | outSlope: 0 80 | tangentMode: 0 81 | weightedMode: 0 82 | inWeight: 0.33333334 83 | outWeight: 0.33333334 84 | m_PreInfinity: 2 85 | m_PostInfinity: 2 86 | m_RotationOrder: 4 87 | panLevelCustomCurve: 88 | serializedVersion: 2 89 | m_Curve: 90 | - serializedVersion: 3 91 | time: 0 92 | value: 0 93 | inSlope: 0 94 | outSlope: 0 95 | tangentMode: 0 96 | weightedMode: 0 97 | inWeight: 0.33333334 98 | outWeight: 0.33333334 99 | m_PreInfinity: 2 100 | m_PostInfinity: 2 101 | m_RotationOrder: 4 102 | spreadCustomCurve: 103 | serializedVersion: 2 104 | m_Curve: 105 | - serializedVersion: 3 106 | time: 0 107 | value: 0 108 | inSlope: 0 109 | outSlope: 0 110 | tangentMode: 0 111 | weightedMode: 0 112 | inWeight: 0.33333334 113 | outWeight: 0.33333334 114 | m_PreInfinity: 2 115 | m_PostInfinity: 2 116 | m_RotationOrder: 4 117 | reverbZoneMixCustomCurve: 118 | serializedVersion: 2 119 | m_Curve: 120 | - serializedVersion: 3 121 | time: 0 122 | value: 1 123 | inSlope: 0 124 | outSlope: 0 125 | tangentMode: 0 126 | weightedMode: 0 127 | inWeight: 0.33333334 128 | outWeight: 0.33333334 129 | m_PreInfinity: 2 130 | m_PostInfinity: 2 131 | m_RotationOrder: 4 132 | --- !u!114 &223430405410468773 133 | MonoBehaviour: 134 | m_ObjectHideFlags: 0 135 | m_CorrespondingSourceObject: {fileID: 0} 136 | m_PrefabInstance: {fileID: 0} 137 | m_PrefabAsset: {fileID: 0} 138 | m_GameObject: {fileID: 6682474810795130509} 139 | m_Enabled: 1 140 | m_EditorHideFlags: 0 141 | m_Script: {fileID: 11500000, guid: 3f32baa4b05a9fa40a45c303a938fbb7, type: 3} 142 | m_Name: 143 | m_EditorClassIdentifier: 144 | -------------------------------------------------------------------------------- /Scripts/UpgradeManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class UpgradeManager : MonoBehaviour 6 | { 7 | public List statUpgrades = new List(); 8 | private List upgradesIncludingWeapons = new List(); 9 | public List weaponUpgrades = new List(); 10 | public List activeCyberwareUpgrades = new List(); 11 | 12 | [Header("Cyberware Upgrades")] 13 | [SerializeField] private CyberwareUpgrade sandevistanUpgrade; 14 | [SerializeField] private CyberwareUpgrade angelFireUpgrade; 15 | 16 | private void Start() 17 | { 18 | foreach(Upgrade u in statUpgrades) 19 | upgradesIncludingWeapons.Add(u); 20 | 21 | foreach(Upgrade u in weaponUpgrades) 22 | upgradesIncludingWeapons.Add(u); 23 | } 24 | 25 | public List GetRandomUpgrades(float amount) 26 | { 27 | if(PlayerManager.instance.playerStats.WeaponSlots > PlayerManager.instance.weaponController.WeaponCount) 28 | return AllUpgrades(amount); 29 | else 30 | return StatUpgrades(amount); 31 | } 32 | public List StatUpgrades(float amount) 33 | { 34 | List selectedUpgrades = new List(); 35 | for (int i = 0; i < amount; i++) 36 | { 37 | Upgrade u = statUpgrades[Random.Range(0, statUpgrades.Count)]; 38 | 39 | if(!selectedUpgrades.Contains(u) && SpaceAvailableForWeapon(u)) 40 | { 41 | selectedUpgrades.Add(u); 42 | } 43 | else 44 | i--; 45 | 46 | if(statUpgrades.Count==i+1) 47 | { 48 | Debug.Log($"Not enough left {amount}"); 49 | return selectedUpgrades; 50 | } 51 | } 52 | return selectedUpgrades; 53 | } 54 | public List AllUpgrades(float amount) 55 | { 56 | List selectedUpgrades = new List(); 57 | for (int i = 0; i < amount; i++) 58 | { 59 | Upgrade u = upgradesIncludingWeapons[Random.Range(0, upgradesIncludingWeapons.Count)]; 60 | 61 | if(!selectedUpgrades.Contains(u)) 62 | { 63 | selectedUpgrades.Add(u); 64 | } 65 | else 66 | i--; 67 | 68 | if(upgradesIncludingWeapons.Count==i+1) 69 | { 70 | Debug.Log($"Not enough left {amount}"); 71 | return selectedUpgrades; 72 | } 73 | } 74 | return selectedUpgrades; 75 | } 76 | public List GetWeaponUpgrades(float amount) 77 | { 78 | List selectedUpgrades = new List(); 79 | for (int i = 0; i < amount; i++) 80 | { 81 | Upgrade u = weaponUpgrades[Random.Range(0, weaponUpgrades.Count)]; 82 | 83 | if(!selectedUpgrades.Contains(u)) 84 | selectedUpgrades.Add(u); 85 | else 86 | i--; 87 | 88 | if(weaponUpgrades.Count==i+1) 89 | { 90 | // Debug.Log($"Not enough weaponUpgrades left {amount}"); 91 | return selectedUpgrades; 92 | } 93 | } 94 | return selectedUpgrades; 95 | } 96 | private bool SpaceAvailableForWeapon(Upgrade u) 97 | { 98 | if(u.upgradeType==Upgrade.UpgradeType.weapon) 99 | return PlayerManager.instance.playerStats.WeaponSlots > PlayerManager.instance.weaponController.WeaponCount; 100 | 101 | return true; 102 | } 103 | public void LoadCyberware(CyberwareUpgrade cyberwareUpgrade) 104 | { 105 | activeCyberwareUpgrades.Add(cyberwareUpgrade); 106 | PlayerManager.instance.uIManager.LoadCyberUpgrade(cyberwareUpgrade.cyberwareType, activeCyberwareUpgrades.Count); 107 | PlayerManager.instance.cyberwareManager.LoadCyberware(cyberwareUpgrade); 108 | } 109 | public bool SandevistanOnline() 110 | { 111 | return activeCyberwareUpgrades.Contains(sandevistanUpgrade); 112 | } 113 | public bool AngelFireOnline() 114 | { 115 | return activeCyberwareUpgrades.Contains(angelFireUpgrade); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /Scripts/UI/MetaProgressionUI.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using TMPro; 5 | using UnityEngine.UI; 6 | 7 | public class MetaProgressionUI : MonoBehaviour 8 | { 9 | public MetaProgressionContainer metaProgressionContainer; 10 | [SerializeField] private Image outlineImage; 11 | [SerializeField] private TMP_Text statName, statIncreaseAmount, statLevel, statCost; 12 | [SerializeField] private Color inProgressColor, highlightedColor, maxedColor; 13 | [SerializeField] private Slider slider; 14 | private Color desiredColor; 15 | private int currentCost; 16 | private bool pointerUp; 17 | public void LoadMetaUI(MetaProgressionContainer metaProgressionContainer) 18 | { 19 | this.metaProgressionContainer = metaProgressionContainer; 20 | RefreshUI(); 21 | } 22 | private void RefreshUI() 23 | { 24 | statName.text = metaProgressionContainer.metaProgressionSO.name; 25 | 26 | for (int i = 0; i < metaProgressionContainer.metaLevels.Count; i++) 27 | { 28 | if(!metaProgressionContainer.metaLevels[i].unlocked) 29 | { 30 | desiredColor = inProgressColor; 31 | outlineImage.color = desiredColor; 32 | float currentAmount; 33 | if(i!=0) 34 | currentAmount = metaProgressionContainer.metaLevels[i-1].modificaitonAmount; 35 | else //get the base value 36 | currentAmount = GameManager.instance.metaProgressionManager.playerBaseStats.Find(x => x.metaProgressionSO == metaProgressionContainer.metaProgressionSO).baseValue; 37 | 38 | float nextAmount = metaProgressionContainer.metaLevels[i].modificaitonAmount; 39 | string percentage = ""; 40 | if(nextAmount>=100) 41 | percentage = "%"; 42 | 43 | statIncreaseAmount.text = $"{currentAmount}{percentage} > {nextAmount}{percentage}"; 44 | 45 | statLevel.text = $"{i} / {metaProgressionContainer.metaLevels.Count}"; 46 | currentCost = (int)metaProgressionContainer.metaLevels[i].cost; 47 | statCost.text = currentCost.ToString(); 48 | break; 49 | } 50 | 51 | if(i == metaProgressionContainer.metaLevels.Count-1) 52 | { 53 | desiredColor = maxedColor; 54 | outlineImage.color = desiredColor; 55 | 56 | float currentAmount = metaProgressionContainer.metaLevels[i].modificaitonAmount; 57 | string percentage = ""; 58 | if(currentAmount>=100) 59 | percentage = "%"; 60 | 61 | statIncreaseAmount.text = $"{currentAmount}{percentage}"; 62 | statLevel.text = $"{metaProgressionContainer.metaLevels.Count} / {metaProgressionContainer.metaLevels.Count}"; 63 | statCost.text = ""; 64 | slider.gameObject.SetActive(false); 65 | } 66 | } 67 | } 68 | public void OnPointerEnter() 69 | { 70 | outlineImage.color = highlightedColor; 71 | } 72 | public void OnPointerExit() 73 | { 74 | outlineImage.color = desiredColor; 75 | } 76 | public void OnPointerDown() 77 | { 78 | pointerUp = false; 79 | if(GameManager.instance.saveSystem.GetCurrency() >= currentCost) 80 | StartCoroutine(OnPointerDownRoutine()); 81 | } 82 | public void OnPointerUp() 83 | { 84 | pointerUp = true; 85 | slider.value = 0f; 86 | } 87 | private IEnumerator OnPointerDownRoutine() 88 | { 89 | slider.value = 0f; 90 | float duration = 0.5f; 91 | float startTime = Time.time; 92 | float endTime = startTime + duration; 93 | while (Time.time < endTime) 94 | { 95 | if(pointerUp) 96 | yield break; 97 | 98 | float t = (Time.time - startTime) / duration; 99 | slider.value = Mathf.Lerp(0f, 1f, t); 100 | yield return null; 101 | } 102 | slider.value = 0f; 103 | GameManager.instance.saveSystem.AddCurrency(-currentCost); 104 | GameManager.instance.metaProgressionManager.UnlockMetaProgression(metaProgressionContainer.metaProgressionSO); 105 | LoadMetaUI(GameManager.instance.metaProgressionManager.metaProgressionContainers.Find(x => x.metaProgressionSO == metaProgressionContainer.metaProgressionSO)); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Scripts/Management/Spawner.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class Spawner : MonoBehaviour 6 | { 7 | [SerializeField] public float minDistanceFromPlayerToSpawn, maxDistanceFromPlayerToSpawn; 8 | public Wave[] waves; 9 | int enemiesRemainingToSpawn, enemiesRemainingAlive, currentWaveNumber = 0; 10 | float nextSpawnTime; 11 | private int spawnLayer = 10; 12 | private int spawnLayerMask; 13 | public List spawnZones; 14 | public SpawnBlocker spawnBlocker; 15 | public bool spawnClose; 16 | Wave currentWave; 17 | Enemy enemyToSpawn; 18 | private void Start() 19 | { 20 | if(spawnClose) 21 | spawnBlocker.transform.localScale = new Vector3(5, 1, 5); 22 | 23 | spawnLayerMask = (1 << spawnLayer); 24 | float totalGameTime = 0; 25 | foreach(Wave wave in waves) 26 | { 27 | wave.CreateWave(); 28 | totalGameTime+= wave.timeBetweenSpawns * wave.enemies.Count; 29 | } 30 | Debug.Log($"Total Game Time: {FormatTime(totalGameTime)}"); 31 | } 32 | public string FormatTime( float time ) 33 | { 34 | int minutes = (int) time / 60 ; 35 | int seconds = (int) time - 60 * minutes; 36 | int milliseconds = (int) (1000 * (time - minutes * 60 - seconds)); 37 | return string.Format("{0:00}:{1:00}:{2:000}", minutes, seconds, milliseconds ); 38 | } 39 | public void Update(){ 40 | 41 | if(enemiesRemainingToSpawn > 0 && Time.time > nextSpawnTime) 42 | { 43 | enemiesRemainingToSpawn--; 44 | enemyToSpawn = currentWave.enemies[enemiesRemainingToSpawn]; 45 | 46 | nextSpawnTime = Time.time + currentWave.timeBetweenSpawns; 47 | 48 | if(spawnZones.Count==0) 49 | return; 50 | 51 | Vector3 spawnPoint = RandomPointInBounds(spawnZones[Random.Range(0,spawnZones.Count)].bounds); 52 | 53 | Enemy spawnedEnemy = Instantiate(enemyToSpawn, spawnPoint, Quaternion.identity) as Enemy; 54 | // spawnedEnemy.OnDeath += OnEnemyDeath; 55 | 56 | if(enemiesRemainingToSpawn==0) 57 | NextWave(); 58 | } 59 | } 60 | public void RespawnEnemy(Enemy spawnedEnemy) 61 | { 62 | if(spawnZones.Count==0) 63 | { 64 | Debug.Log($"No spawn zones found for {spawnedEnemy.name}"); 65 | return; 66 | } 67 | 68 | Vector3 spawnPoint = RandomPointInBounds(spawnZones[Random.Range(0,spawnZones.Count)].bounds); 69 | 70 | spawnedEnemy.gameObject.transform.position = spawnPoint; 71 | // spawnedEnemy.OnDeath += OnEnemyDeath; 72 | } 73 | // private void OnEnemyDeath() 74 | // { 75 | // enemiesRemainingAlive--; 76 | // if(enemiesRemainingAlive==0) 77 | // { 78 | // NextWave(); 79 | // } 80 | // } 81 | public void NextWave() 82 | { 83 | currentWaveNumber ++; 84 | if(currentWaveNumber -1 >= waves.Length) 85 | return; 86 | 87 | currentWave = waves[currentWaveNumber - 1]; 88 | 89 | currentWave.CreateWave(); 90 | enemiesRemainingToSpawn = currentWave.enemies.Count; 91 | enemiesRemainingAlive = enemiesRemainingToSpawn; 92 | } 93 | [System.Serializable] public class Wave{ 94 | public float timeBetweenSpawns; 95 | public List subWaves; 96 | [HideInInspector] public List enemies = new List(); 97 | public void CreateWave() 98 | { 99 | foreach(SubWave subWave in subWaves) 100 | { 101 | for(int i = 0; i < subWave.enemyCount; i++) 102 | enemies.Add(subWave.enemy); 103 | } 104 | ListExtensions.Shuffle(enemies); 105 | } 106 | } 107 | [System.Serializable] public class SubWave{ 108 | public int enemyCount; 109 | public Enemy enemy; 110 | } 111 | 112 | public static Vector3 RandomPointInBounds(Bounds bounds) { 113 | return new Vector3( 114 | Random.Range(bounds.min.x, bounds.max.x), 115 | 0, 116 | // Random.Range(bounds.min.y, bounds.max.y), 117 | Random.Range(bounds.min.z, bounds.max.z) 118 | ); 119 | } 120 | 121 | } 122 | public static class ListExtensions 123 | { 124 | public static void Shuffle(this IList list) 125 | { 126 | System.Random rnd = new System.Random(); 127 | for (var i = 0; i < list.Count; i++) 128 | list.Swap(i, rnd.Next(i, list.Count)); 129 | } 130 | public static void Swap(this IList list, int i, int j) 131 | { 132 | (list[i], list[j]) = (list[j], list[i]); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /Scripts/Map/SerializableDictionary/SerializableHashSet.cs: -------------------------------------------------------------------------------- 1 | #if NET_4_6 || NET_STANDARD_2_0 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Runtime.Serialization; 6 | using UnityEngine; 7 | 8 | public abstract class SerializableHashSetBase 9 | { 10 | public abstract class Storage {} 11 | 12 | protected class HashSet : System.Collections.Generic.HashSet 13 | { 14 | public HashSet() {} 15 | public HashSet(ISet set) : base(set) {} 16 | public HashSet(SerializationInfo info, StreamingContext context) : base(info, context) {} 17 | } 18 | } 19 | 20 | [Serializable] 21 | public abstract class SerializableHashSet : SerializableHashSetBase, ISet, ISerializationCallbackReceiver, IDeserializationCallback, ISerializable 22 | { 23 | HashSet m_hashSet; 24 | [SerializeField] 25 | T[] m_keys; 26 | 27 | public SerializableHashSet() 28 | { 29 | m_hashSet = new HashSet(); 30 | } 31 | 32 | public SerializableHashSet(ISet set) 33 | { 34 | m_hashSet = new HashSet(set); 35 | } 36 | 37 | public void CopyFrom(ISet set) 38 | { 39 | m_hashSet.Clear(); 40 | foreach (var value in set) 41 | { 42 | m_hashSet.Add(value); 43 | } 44 | } 45 | 46 | public void OnAfterDeserialize() 47 | { 48 | if(m_keys != null) 49 | { 50 | m_hashSet.Clear(); 51 | int n = m_keys.Length; 52 | for(int i = 0; i < n; ++i) 53 | { 54 | m_hashSet.Add(m_keys[i]); 55 | } 56 | 57 | m_keys = null; 58 | } 59 | } 60 | 61 | public void OnBeforeSerialize() 62 | { 63 | int n = m_hashSet.Count; 64 | m_keys = new T[n]; 65 | 66 | int i = 0; 67 | foreach(var value in m_hashSet) 68 | { 69 | m_keys[i] = value; 70 | ++i; 71 | } 72 | } 73 | 74 | #region ISet 75 | 76 | public int Count { get { return ((ISet)m_hashSet).Count; } } 77 | public bool IsReadOnly { get { return ((ISet)m_hashSet).IsReadOnly; } } 78 | 79 | public bool Add(T item) 80 | { 81 | return ((ISet)m_hashSet).Add(item); 82 | } 83 | 84 | public void ExceptWith(IEnumerable other) 85 | { 86 | ((ISet)m_hashSet).ExceptWith(other); 87 | } 88 | 89 | public void IntersectWith(IEnumerable other) 90 | { 91 | ((ISet)m_hashSet).IntersectWith(other); 92 | } 93 | 94 | public bool IsProperSubsetOf(IEnumerable other) 95 | { 96 | return ((ISet)m_hashSet).IsProperSubsetOf(other); 97 | } 98 | 99 | public bool IsProperSupersetOf(IEnumerable other) 100 | { 101 | return ((ISet)m_hashSet).IsProperSupersetOf(other); 102 | } 103 | 104 | public bool IsSubsetOf(IEnumerable other) 105 | { 106 | return ((ISet)m_hashSet).IsSubsetOf(other); 107 | } 108 | 109 | public bool IsSupersetOf(IEnumerable other) 110 | { 111 | return ((ISet)m_hashSet).IsSupersetOf(other); 112 | } 113 | 114 | public bool Overlaps(IEnumerable other) 115 | { 116 | return ((ISet)m_hashSet).Overlaps(other); 117 | } 118 | 119 | public bool SetEquals(IEnumerable other) 120 | { 121 | return ((ISet)m_hashSet).SetEquals(other); 122 | } 123 | 124 | public void SymmetricExceptWith(IEnumerable other) 125 | { 126 | ((ISet)m_hashSet).SymmetricExceptWith(other); 127 | } 128 | 129 | public void UnionWith(IEnumerable other) 130 | { 131 | ((ISet)m_hashSet).UnionWith(other); 132 | } 133 | 134 | void ICollection.Add(T item) 135 | { 136 | ((ISet)m_hashSet).Add(item); 137 | } 138 | 139 | public void Clear() 140 | { 141 | ((ISet)m_hashSet).Clear(); 142 | } 143 | 144 | public bool Contains(T item) 145 | { 146 | return ((ISet)m_hashSet).Contains(item); 147 | } 148 | 149 | public void CopyTo(T[] array, int arrayIndex) 150 | { 151 | ((ISet)m_hashSet).CopyTo(array, arrayIndex); 152 | } 153 | 154 | public bool Remove(T item) 155 | { 156 | return ((ISet)m_hashSet).Remove(item); 157 | } 158 | 159 | public IEnumerator GetEnumerator() 160 | { 161 | return ((ISet)m_hashSet).GetEnumerator(); 162 | } 163 | 164 | IEnumerator IEnumerable.GetEnumerator() 165 | { 166 | return ((ISet)m_hashSet).GetEnumerator(); 167 | } 168 | 169 | #endregion 170 | 171 | #region IDeserializationCallback 172 | 173 | public void OnDeserialization(object sender) 174 | { 175 | ((IDeserializationCallback)m_hashSet).OnDeserialization(sender); 176 | } 177 | 178 | #endregion 179 | 180 | #region ISerializable 181 | 182 | protected SerializableHashSet(SerializationInfo info, StreamingContext context) 183 | { 184 | m_hashSet = new HashSet(info, context); 185 | } 186 | 187 | public void GetObjectData(SerializationInfo info, StreamingContext context) 188 | { 189 | ((ISerializable)m_hashSet).GetObjectData(info, context); 190 | } 191 | 192 | #endregion 193 | } 194 | #endif -------------------------------------------------------------------------------- /Scripts/Management/GameStateManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System.Threading.Tasks; 5 | using UnityEngine.SceneManagement; 6 | public enum SceneIndexes 7 | { 8 | Start = 0, 9 | MainMenu = 1, 10 | InGame = 2, 11 | Map = 3, 12 | PostGame = 4 13 | } 14 | public class GameStateManager : MonoBehaviour 15 | { 16 | public static GameStateManager instance; 17 | public GameStateEnum currentGameState; 18 | public bool sceneChangeInProgress; 19 | public CanvasGroup blackUIScreen; 20 | public WaitForSeconds pauseLength = new WaitForSeconds(0.5f); 21 | [HideInInspector] public int tavernSceneNumber = 1; 22 | public bool quickStart; 23 | 24 | private void Awake() 25 | { 26 | if(instance==null) 27 | instance = this; 28 | else 29 | { 30 | Destroy(gameObject); 31 | return; 32 | } 33 | DontDestroyOnLoad(gameObject); 34 | } 35 | private void Start() 36 | { 37 | if(quickStart) 38 | { 39 | PlayerManager.instance.StartGame(); 40 | SceneManager.SetActiveScene(SceneManager.GetSceneByBuildIndex((int)SceneIndexes.InGame)); 41 | } 42 | else 43 | SwitchGameState(GameStateEnum.MainMenu); 44 | } 45 | public void SwitchGameState(GameStateEnum gameStateEnum) 46 | { 47 | currentGameState = gameStateEnum; 48 | StartCoroutine(SwitchGameState()); 49 | } 50 | public void QuickFadeIn() 51 | { 52 | StartCoroutine(blackUIScreen.FadeIn()); 53 | } 54 | public void QuickFadeOut() 55 | { 56 | StartCoroutine(blackUIScreen.FadeOut()); 57 | } 58 | public IEnumerator SwitchGameState() 59 | { 60 | sceneChangeInProgress = true; 61 | StartCoroutine(blackUIScreen.FadeIn()); 62 | yield return pauseLength; 63 | 64 | switch (currentGameState) 65 | { 66 | case GameStateEnum.MainMenu: 67 | //check if scene is loaded, if not, load it 68 | if(!SceneManager.GetSceneByBuildIndex((int)SceneIndexes.MainMenu).isLoaded) 69 | { 70 | StartCoroutine(LoadScene((int)SceneIndexes.MainMenu)); 71 | } 72 | else 73 | { 74 | yield return new WaitForSeconds(0.25f); 75 | StartCoroutine(CompleteSceneLoad()); 76 | } 77 | UnloadScene((int)SceneIndexes.InGame); 78 | UnloadScene((int)SceneIndexes.PostGame); 79 | break; 80 | case GameStateEnum.InGame: 81 | StartCoroutine(LoadScene((int)SceneIndexes.InGame)); 82 | UnloadScene((int)SceneIndexes.PostGame); 83 | UnloadScene((int)SceneIndexes.MainMenu); 84 | break; 85 | case GameStateEnum.PostGame: 86 | StartCoroutine(LoadScene((int)SceneIndexes.PostGame)); 87 | UnloadScene((int)SceneIndexes.InGame); 88 | UnloadScene((int)SceneIndexes.Map); 89 | break; 90 | case GameStateEnum.Restart: 91 | UnloadScene((int)SceneIndexes.InGame); 92 | UnloadScene((int)SceneIndexes.Map); 93 | GameStateManager.instance.SwitchGameState(GameStateEnum.InGame); 94 | break; 95 | } 96 | } 97 | private void UnloadScene(int sceneNumber) 98 | { 99 | if(SceneManager.GetSceneByBuildIndex(sceneNumber).isLoaded) 100 | SceneManager.UnloadSceneAsync(sceneNumber); 101 | } 102 | private IEnumerator LoadScene(int sceneNumber) 103 | { 104 | if(!SceneManager.GetSceneByBuildIndex(sceneNumber).isLoaded) 105 | { 106 | AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(sceneNumber, LoadSceneMode.Additive); 107 | while (!asyncLoad.isDone) 108 | yield return null; 109 | } 110 | StartCoroutine(CompleteSceneLoad()); 111 | } 112 | private IEnumerator CompleteSceneLoad() 113 | { 114 | StartCoroutine(blackUIScreen.FadeOut()); 115 | yield return pauseLength; 116 | sceneChangeInProgress = false; 117 | 118 | switch (currentGameState) 119 | { 120 | case GameStateEnum.Restart: 121 | Debug.Log($"restarted game"); 122 | SceneManager.SetActiveScene(SceneManager.GetSceneByBuildIndex((int)SceneIndexes.InGame)); 123 | PlayerManager.instance.StartGame(); 124 | break; 125 | case GameStateEnum.InGame: 126 | SceneManager.SetActiveScene(SceneManager.GetSceneByBuildIndex((int)SceneIndexes.InGame)); 127 | PlayerManager.instance.StartGame(); 128 | break; 129 | } 130 | } 131 | } 132 | public enum GameStateEnum{MainMenu, InGame, Restart, PostGame} 133 | 134 | 135 | -------------------------------------------------------------------------------- /Scripts/Entities/Enemy.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using TJAudio; 5 | 6 | public class Enemy : LivingEntity, IDamageable 7 | { 8 | [SerializeField] private ExpShard expShard; 9 | public float moveSpeed, attackDistanceThreshold = 1f, timeBetweenAttacks = 1f; 10 | float nextAttackTime, attackRange; 11 | bool hasTarget; 12 | public float damage; 13 | public SkinnedMeshRenderer meshRenderer; 14 | public float flashDuration; 15 | private Coroutine flashOnHit; 16 | private WaitForSeconds flashWait; 17 | private Material origionalMaterial; 18 | Transform targetTransform; 19 | LivingEntity player; 20 | [SerializeField] protected Animator animator; 21 | Rigidbody rb; 22 | 23 | protected bool enemyMovementOverride; 24 | 25 | protected override void Start() 26 | { 27 | base.Start(); 28 | if(PlayerManager.instance==null) 29 | return; 30 | 31 | targetTransform = PlayerManager.instance.gameObject.transform; 32 | player = PlayerManager.instance.GetComponent(); 33 | animator = GetComponentInChildren(); 34 | rb = GetComponent(); 35 | flashWait = new WaitForSeconds(flashDuration); 36 | origionalMaterial = meshRenderer.material; 37 | 38 | GetComponent().OnDamage += EnemyTakeDamage; 39 | player.OnDeath += OnTargetDeath; 40 | this.OnDeath += OnEnemyDeath; 41 | hasTarget = true; 42 | } 43 | private void Update() 44 | { 45 | if(dead) 46 | return; 47 | 48 | if(targetTransform == null) 49 | DestroyImmediate(gameObject); 50 | 51 | if(enemyMovementOverride) 52 | return; 53 | 54 | if(TooFarAway()) 55 | { 56 | PlayerManager.instance.spawner.RespawnEnemy(this); 57 | } 58 | 59 | if(rb==null) 60 | return; 61 | 62 | rb.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezePositionY; 63 | animator.speed = Sandevistan.instance.sandevistanActive ? 1 / 20 : 1; 64 | 65 | 66 | float movementSpeed = Sandevistan.instance.sandevistanActive ? moveSpeed / 20 : moveSpeed; 67 | transform.position = Vector3.MoveTowards(transform.position, targetTransform.position, Time.deltaTime * movementSpeed); 68 | 69 | if(Sandevistan.instance.sandevistanActive) 70 | { 71 | rb.constraints = RigidbodyConstraints.FreezeAll; 72 | return; 73 | } 74 | 75 | transform.LookAt(targetTransform.position); 76 | 77 | if(Time.time > nextAttackTime) 78 | { 79 | float sqrDistance = (targetTransform.position - transform.position).sqrMagnitude; 80 | // Debug.Log($"tried to attack {sqrDistance}"); 81 | if(sqrDistance < Mathf.Pow(attackDistanceThreshold, 2)){ 82 | nextAttackTime = Time.time + timeBetweenAttacks; 83 | Attack(); 84 | } 85 | } 86 | } 87 | private bool TooFarAway() 88 | { 89 | if(targetTransform == null) 90 | return false; 91 | 92 | float distanceAway = Vector3.Distance(targetTransform.position, transform.position); 93 | // if((targetTransform.position - transform.position).sqrMagnitude > Mathf.Pow(attackDistanceThreshold, 2)) 94 | // return true; 95 | if(distanceAway > 30) 96 | { 97 | Debug.Log($"too far away {distanceAway}"); 98 | return true; 99 | } 100 | 101 | return false; 102 | } 103 | private void OnTargetDeath() 104 | { 105 | hasTarget = false; 106 | } 107 | private void Attack(){ 108 | player.TakeDamage(damage); 109 | IAudioRequester.instance.PlaySFX("playerDamage"); 110 | } 111 | private void OnEnemyDeath() 112 | { 113 | StartCoroutine(DieAfterFlash()); 114 | PlayerManager.instance.enemiesSlain++; 115 | } 116 | public IEnumerator DieAfterFlash() 117 | { 118 | while(flashOnHit!=null) 119 | yield return null; 120 | 121 | Instantiate(expShard.shardPrefab, this.transform.position, Quaternion.identity); 122 | GameObject.Destroy(gameObject); 123 | } 124 | public IEnumerator FlashOnHit() 125 | { 126 | meshRenderer.material = PlayerManager.instance.flashMaterial; 127 | yield return flashWait; 128 | meshRenderer.material = origionalMaterial; 129 | flashOnHit = null; 130 | } 131 | public void Flash() 132 | { 133 | if(flashOnHit!=null) 134 | StopCoroutine(flashOnHit); 135 | 136 | flashOnHit = StartCoroutine(FlashOnHit()); 137 | } 138 | public void EnemyTakeDamage(float damage) 139 | { 140 | health -= damage; 141 | if(!dead) 142 | Flash(); 143 | 144 | if(health<=0&&!dead) 145 | Die(); 146 | } 147 | 148 | } 149 | -------------------------------------------------------------------------------- /Scripts/Map/PrototypeGenerator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | using UnityEngine.Windows; 6 | public class PrototypeGenerator : MonoBehaviour 7 | { 8 | public List protoypePrefabs; 9 | public List prototypes; 10 | public string path = "Assets/Data/Prototypes"; 11 | WFC_Socket posXHolder; 12 | WFC_Socket negXHolder; 13 | WFC_Socket posZHolder; 14 | WFC_Socket negZHolder; 15 | List prototypeHolder = new List(); 16 | 17 | [SerializeField] private GameObject prototypeHolderPrefab; 18 | 19 | [ContextMenu("Generate Prototypes")] 20 | public void GeneratePrototypes() 21 | { 22 | prototypes.Clear(); 23 | #if UNITY_EDITOR 24 | if (Directory.Exists(path)) 25 | Directory.Delete(path); 26 | 27 | Directory.CreateDirectory(path); 28 | #endif 29 | 30 | // Generate rotations for all prototypes 31 | for (int i = 0; i < protoypePrefabs.Count; i++) 32 | { 33 | for (int j = 0; j < 4; j++) 34 | { 35 | Prototype newProto = CreateMyAsset(path, protoypePrefabs[i].name, j.ToString().Replace(" ", "")); 36 | prototypes.Add(newProto); 37 | } 38 | } 39 | UpdatePrototypes(); 40 | 41 | prototypeHolderPrefab.GetComponent().possiblePrototypes = prototypes; 42 | } 43 | public void UpdatePrototypes() 44 | { 45 | // Generate rotations for all prototypes 46 | for (int i = 0; i < protoypePrefabs.Count; i++) 47 | { 48 | for (int j = 0; j < 4; j++) 49 | { 50 | prototypes[i*4+j].prefab = protoypePrefabs[i].prefab; 51 | prototypes[i*4+j].validNeighbours = new NeighbourList(); 52 | prototypes[i*4+j].meshRotation = j; 53 | prototypes[i*4+j].attributes = protoypePrefabs[i].attributes; 54 | 55 | prototypes[i*4+j].posX = protoypePrefabs[i].posX; 56 | prototypes[i*4+j].negX = protoypePrefabs[i].negX; 57 | prototypes[i*4+j].posZ = protoypePrefabs[i].posZ; 58 | prototypes[i*4+j].negZ = protoypePrefabs[i].negZ; 59 | 60 | if(j==0) 61 | { 62 | posXHolder = prototypes[i*4+j].posX; 63 | negXHolder = prototypes[i*4+j].negX; 64 | posZHolder = prototypes[i*4+j].posZ; 65 | negZHolder = prototypes[i*4+j].negZ; 66 | } 67 | else 68 | { 69 | prototypes[i*4+j].negZ = posXHolder; 70 | prototypes[i*4+j].negX = negZHolder; 71 | prototypes[i*4+j].posZ = negXHolder; 72 | prototypes[i*4+j].posX = posZHolder; 73 | 74 | posXHolder = prototypes[i*4+j].posX; 75 | negXHolder = prototypes[i*4+j].negX; 76 | posZHolder = prototypes[i*4+j].posZ; 77 | negZHolder = prototypes[i*4+j].negZ; 78 | } 79 | } 80 | } 81 | 82 | // // Generate valid neighbors 83 | for (int i = 0; i < prototypes.Count; i++) 84 | prototypes[i].validNeighbours = GetValidNeighbors(prototypes[i]); 85 | } 86 | public static Prototype CreateMyAsset(string assetFolder, string name, string j) 87 | { 88 | Prototype asset = ScriptableObject.CreateInstance(); 89 | #if UNITY_EDITOR 90 | AssetDatabase.CreateAsset(asset, assetFolder+"/"+name+"_"+j+".asset"); 91 | EditorUtility.SetDirty(asset); 92 | AssetDatabase.SaveAssets(); 93 | 94 | EditorUtility.FocusProjectWindow(); 95 | #endif 96 | 97 | return asset; 98 | } 99 | private NeighbourList GetValidNeighbors(Prototype proto) 100 | { 101 | NeighbourList neighbourList = new NeighbourList(); 102 | foreach(Prototype p in prototypes) 103 | { 104 | if(proto.posX==p.negX) 105 | neighbourList.posX.Add(p); 106 | if(proto.negX==p.posX) 107 | neighbourList.negX.Add(p); 108 | if(proto.posZ==p.negZ) 109 | neighbourList.posZ.Add(p); 110 | if(proto.negZ==p.posZ) 111 | neighbourList.negZ.Add(p); 112 | } 113 | return neighbourList; 114 | } 115 | public void DisplayPrototypes() 116 | { 117 | if(prototypeHolder.Count!=0) 118 | { 119 | foreach(GameObject p in prototypeHolder) 120 | DestroyImmediate(p); 121 | 122 | prototypeHolder = new List(); 123 | } 124 | 125 | for (int i = 0; i < protoypePrefabs.Count; i++) 126 | { 127 | for (int j = 0; j < 4; j++) 128 | { 129 | GameObject protoObj = Instantiate(protoypePrefabs[i].prefab, new Vector3(i*1.5f, 0f, j*1.5f), Quaternion.identity, this.transform); 130 | protoObj.transform.Rotate(new Vector3(0f, j*90, 0f), Space.Self); 131 | protoObj.name = (protoypePrefabs[i].prefab.name +"_"+j.ToString()); 132 | prototypeHolder.Add(protoObj); 133 | } 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /Scripts/SaveData/SaveSystem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SaveSystem : MonoBehaviour 6 | { 7 | string filename = "SaveData"; 8 | public List weapons; 9 | 10 | public WeaponUnlocks GetWeaponUnlock(WeaponType weapon) 11 | { 12 | SaveData saveData = GetSaveDataFromJson(); 13 | WeaponUnlocks weaponUnlock = saveData.weaponUnlocks.Find(x => x.weapon == weapon); 14 | return weaponUnlock; 15 | } 16 | public void UnlockWeaponModification(WeaponUnlocks newWeaponUnlock) 17 | { 18 | SaveData saveData = GetSaveDataFromJson(); 19 | saveData.UpdateWeaponModification(newWeaponUnlock); 20 | JSONFileHandler.SaveToJSON (saveData, filename); 21 | Debug.Log($"saved weapon modification"); 22 | } 23 | public List GetMetaProgression() 24 | { 25 | SaveData saveData = GetSaveDataFromJson(); 26 | return saveData.LoadMetaProgression(); 27 | } 28 | public void RecordRecentGame(int rewardAmount, float timeSurvived, int enemiesKilled, int level) 29 | { 30 | SaveData saveData = GetSaveDataFromJson(); 31 | saveData.recentGame = new RecentGame(rewardAmount, timeSurvived, enemiesKilled, level); 32 | saveData.SaveEddies(rewardAmount); 33 | JSONFileHandler.SaveToJSON (saveData, filename); 34 | } 35 | public RecentGame GetRecentGame() 36 | { 37 | SaveData saveData = GetSaveDataFromJson(); 38 | return saveData.recentGame; 39 | } 40 | 41 | public void SaveMetaProgression() 42 | { 43 | SaveData saveData = GetSaveDataFromJson(); 44 | saveData.SaveMetaProgression(GameManager.instance.metaProgressionManager.metaProgressionContainers); 45 | JSONFileHandler.SaveToJSON (saveData, filename); 46 | } 47 | private SaveData GetSaveDataFromJson() 48 | { 49 | SaveData saveData = JSONFileHandler.ReadListFromJSON(filename); 50 | if(saveData==null) 51 | saveData = new SaveData(weapons, GameManager.instance.metaProgressionManager.metaProgressionContainers); 52 | 53 | return saveData; 54 | } 55 | public void WipeSaveData() 56 | { 57 | SaveData saveData = new SaveData(weapons, GameManager.instance.metaProgressionManager.metaProgressionContainers); 58 | JSONFileHandler.SaveToJSON (saveData, filename); 59 | } 60 | public void AddResources() 61 | { 62 | SaveData saveData = GetSaveDataFromJson(); 63 | saveData.SaveEddies(9999); 64 | JSONFileHandler.SaveToJSON (saveData, filename); 65 | Debug.Log($"saved resources"); 66 | } 67 | public int GetCurrency() 68 | { 69 | SaveData saveData = GetSaveDataFromJson(); 70 | return saveData.currency; 71 | } 72 | public void AddCurrency(int amount) 73 | { 74 | SaveData saveData = GetSaveDataFromJson(); 75 | saveData.SaveEddies(amount); 76 | JSONFileHandler.SaveToJSON (saveData, filename); 77 | Debug.Log($"saved currency"); 78 | } 79 | } 80 | [System.Serializable] public class SaveData 81 | { 82 | public int currency; 83 | public List weaponUnlocks = new List(); 84 | public List metaProgressionContainers = new List(); 85 | public RecentGame recentGame; 86 | public SaveData(List weapons, List _metaProgressionContainers) 87 | { 88 | // for (int i = 0; i < weapons.Count; i++) 89 | // weaponUnlocks.Add(new WeaponUnlocks(weapons[i])); 90 | for (int i = 0; i < _metaProgressionContainers.Count; i++) 91 | { 92 | for (int j = 0; j < _metaProgressionContainers[i].metaLevels.Count; j++) 93 | { 94 | _metaProgressionContainers[i].metaLevels[j].unlocked = false; 95 | } 96 | } 97 | 98 | this.metaProgressionContainers = _metaProgressionContainers; 99 | } 100 | public void SaveEddies(int amount) 101 | { 102 | currency+=amount; 103 | } 104 | public void UpdateWeaponModification(WeaponUnlocks newWeaponUnlock) 105 | { 106 | for (int i = 0; i < weaponUnlocks.Count; i++) 107 | { 108 | if(weaponUnlocks[i].weapon==newWeaponUnlock.weapon) 109 | { 110 | weaponUnlocks[i].upgradeLevels = newWeaponUnlock.upgradeLevels; 111 | } 112 | } 113 | } 114 | public void SaveMetaProgression(List metaProgressionContainers) 115 | { 116 | this.metaProgressionContainers = metaProgressionContainers; 117 | } 118 | public List LoadMetaProgression() 119 | { 120 | return this.metaProgressionContainers; 121 | } 122 | } 123 | [System.Serializable] public class WeaponUnlocks 124 | { 125 | public WeaponType weapon; 126 | public List upgradeLevels = new List(4); 127 | } 128 | [System.Serializable] public struct RecentGame 129 | { 130 | public int rewardAmount; 131 | public float timeSurvived; 132 | public int enemiesKilled; 133 | public int playerLevel; 134 | public RecentGame(int rewardAmount, float timeSurvived, int enemiesKilled, int playerLevel) 135 | { 136 | this.rewardAmount = rewardAmount; 137 | this.timeSurvived = timeSurvived; 138 | this.enemiesKilled = enemiesKilled; 139 | this.playerLevel = playerLevel; 140 | } 141 | } 142 | 143 | -------------------------------------------------------------------------------- /Scripts/Player/InputHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class InputHandler : MonoBehaviour 6 | { 7 | public float horizontal, vertical; 8 | public bool esc_Input, rollFlag, roll_Input, reload_Input, firingMode_Input, slot_1_Input, slot_2_Input, slot_3_Input, fire_Input, sandevistan_Input; 9 | public float moveAmount; 10 | public Vector2 movementInput, cameraInput; 11 | public PlayerControls inputActions; 12 | public bool fireModeAuto = true; 13 | PlayerMovement playerMovement; 14 | WeaponController weaponController; 15 | UIManager uIManager; 16 | PlayerManager playerManager; 17 | PlayerStats playerStats; 18 | 19 | private void Start() 20 | { 21 | weaponController = GetComponent(); 22 | playerMovement = GetComponent(); 23 | uIManager = PlayerManager.instance.uIManager; 24 | playerManager = GetComponent(); 25 | playerStats = GetComponent(); 26 | fireModeAuto = !fireModeAuto; 27 | } 28 | 29 | public void OnEnable(){ 30 | if (inputActions == null){ 31 | inputActions = new PlayerControls(); 32 | inputActions.PlayerMovement.Movement.performed+= inputActions => movementInput = inputActions.ReadValue(); 33 | inputActions.PlayerActions.Escape.performed += i => esc_Input = true; 34 | inputActions.PlayerActions.Roll.performed += i => roll_Input = true; 35 | inputActions.PlayerActions.Reload.performed += i => reload_Input = true; 36 | inputActions.PlayerActions.FiringMode.performed += i => firingMode_Input = true; 37 | inputActions.PlayerActions.Fire.performed += i => fire_Input = true; 38 | inputActions.PlayerActions.Fire.canceled += i => fire_Input = false; 39 | inputActions.PlayerMovement.Camera.performed+= i => cameraInput = i.ReadValue(); 40 | 41 | inputActions.PlayerActions.Slot_1.performed += i => slot_1_Input = true; 42 | inputActions.PlayerActions.Slot_2.performed += i => slot_2_Input = true; 43 | inputActions.PlayerActions.Slot_3.performed += i => slot_3_Input = true; 44 | 45 | inputActions.PlayerActions.Sandevistan.performed += i => sandevistan_Input = true; 46 | } 47 | inputActions.Enable(); 48 | } 49 | private void OnDisable(){ 50 | inputActions.Disable(); 51 | } 52 | public void TickInput(float delta){ 53 | HandleMoveInput(delta); 54 | HandlePauseInput(); 55 | HandleShootInput(); 56 | HandleRoll(); 57 | HandleReload(); 58 | HandleWeaponSelection(); 59 | HandleFiringMode(); 60 | HandleCyberware(); 61 | HandleHealthRegen(delta); 62 | } 63 | private void HandleCyberware() 64 | { 65 | if(slot_1_Input) 66 | { 67 | slot_1_Input = false; 68 | PlayerManager.instance.cyberwareManager.OverrideSandy(); 69 | PlayerManager.instance.cyberwareManager.HandleCyberware(1); 70 | } 71 | else if(slot_2_Input) 72 | { 73 | slot_2_Input = false; 74 | PlayerManager.instance.cyberwareManager.HandleCyberware(2); 75 | } 76 | else if(slot_3_Input) 77 | { 78 | slot_3_Input = false; 79 | PlayerManager.instance.cyberwareManager.HandleCyberware(3); 80 | } 81 | } 82 | private void HandleHealthRegen(float delta) 83 | { 84 | float regenedHealth = playerStats.HealthRegenRate * delta * playerStats.healthRegenSpeedMultiplier; 85 | playerManager.Heal(regenedHealth); 86 | } 87 | private void HandleMoveInput(float delta){ 88 | 89 | if(playerMovement.animator.GetBool("isInteracting")) 90 | return; 91 | 92 | horizontal = movementInput.x; 93 | vertical = movementInput.y; 94 | // moveAmount = Mathf.Clamp01(Mathf.Abs(horizontal)+Mathf.Abs(vertical)); 95 | playerMovement.Move(movementInput); 96 | playerMovement.UpdateAnimatorValues(vertical, horizontal);//, playerManager.isSprinting); 97 | // mouseX = cameraInput.x; 98 | // mouseY = cameraInput.y; 99 | } 100 | private void HandlePauseInput(){ 101 | 102 | if(esc_Input) 103 | { 104 | esc_Input = false; 105 | if(!uIManager.Paused) 106 | uIManager.OpenPauseCanvas(); 107 | else 108 | uIManager.ClosePauseCanvas(); 109 | } 110 | } 111 | private void HandleShootInput() 112 | { 113 | if(fireModeAuto) 114 | { 115 | weaponController.Shoot(); 116 | } 117 | else if(fire_Input) 118 | { 119 | weaponController.Shoot(); 120 | } 121 | } 122 | private void HandleRoll() 123 | { 124 | if(roll_Input) 125 | { 126 | roll_Input = false; 127 | rollFlag = true; 128 | } 129 | } 130 | private void HandleReload() 131 | { 132 | if(reload_Input) 133 | { 134 | reload_Input = false; 135 | 136 | if(weaponController.CanReload() && !PlayerManager.instance.isReloading) 137 | { 138 | StartCoroutine(PlayerManager.instance.Reload()); 139 | } 140 | } 141 | } 142 | private void HandleWeaponSelection() 143 | { 144 | // if(slot_1_Input) 145 | // { 146 | // slot_1_Input = false; 147 | // if(weaponController.WeaponCount>0) 148 | // weaponController.SelectWeapon(0); 149 | // } 150 | // else if(slot_2_Input) 151 | // { 152 | // slot_2_Input = false; 153 | // if(weaponController.WeaponCount>1) 154 | // weaponController.SelectWeapon(1); 155 | // } 156 | // else if(slot_3_Input) 157 | // { 158 | // slot_3_Input = false; 159 | // if(weaponController.WeaponCount>2) 160 | // weaponController.SelectWeapon(2); 161 | // } 162 | } 163 | private void HandleFiringMode() 164 | { 165 | if(firingMode_Input) 166 | { 167 | firingMode_Input = false; 168 | fireModeAuto = !fireModeAuto; 169 | weaponController.ToggleFireMode(); 170 | } 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /Scripts/Player/PlayerMovement.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class PlayerMovement : MonoBehaviour 6 | { 7 | [SerializeField] private float standardSpeedModifier = 1f, sandevistanSpeedModifier = 5f; 8 | private float speedModifier = 1f; 9 | [SerializeField] private float rollCharges; 10 | Vector2 velocity; 11 | Rigidbody myRigidbody; 12 | PlayerManager playerManager; 13 | PlayerStats playerStats; 14 | InputHandler inputHandler; 15 | UIManager uIManager; 16 | Sandevistan sandevistan; 17 | 18 | public Animator animator; 19 | int vertical,horizontal; 20 | public Vector3 lookPoint; 21 | private void Awake() 22 | { 23 | myRigidbody = GetComponent(); 24 | playerManager = GetComponent(); 25 | playerStats = GetComponent(); 26 | inputHandler = GetComponent(); 27 | animator = GetComponent(); 28 | sandevistan = GetComponent(); 29 | 30 | vertical = Animator.StringToHash("Vertical"); 31 | horizontal = Animator.StringToHash("Horizontal"); 32 | } 33 | private void Start() 34 | { 35 | uIManager = PlayerManager.instance.uIManager; 36 | } 37 | public void PlayTargetAnimation(string targetAnim, bool isInteracting, bool canRotate = false) 38 | { 39 | animator.applyRootMotion = isInteracting; 40 | animator.SetBool("canRotate", canRotate); 41 | animator.SetBool("isInteracting", isInteracting); 42 | animator.CrossFade(targetAnim, 0.2f); 43 | } 44 | public void Move(Vector2 _velocity) 45 | { 46 | velocity = _velocity; 47 | } 48 | private void FixedUpdate() 49 | { 50 | // speedModifier = sandevistan.sandevistanActive ? sandevistanSpeedModifier : standardSpeedModifier; 51 | // Vector3 horizontal = (Vector3.right * velocity.x) + (Vector3.forward * velocity.y); 52 | myRigidbody.MovePosition(myRigidbody.position + new Vector3(velocity.x,0,velocity.y) * Time.fixedDeltaTime * standardSpeedModifier * playerStats.MoveSpeed); 53 | } 54 | public void RechargeRollCharges(float delta) 55 | { 56 | // Recharges roll charges 57 | rollCharges += playerStats.RollChargeRate*delta; 58 | rollCharges = Mathf.Clamp(rollCharges, 0, playerStats.RollCharges); 59 | uIManager.DisplayRollCharge(rollCharges); 60 | } 61 | public void HandleRolling() 62 | { 63 | if(inputHandler.rollFlag) 64 | { 65 | if(rollCharges < 1) 66 | return; 67 | 68 | rollCharges--; 69 | uIManager.DisplayRollCharge(rollCharges); 70 | Vector3 movementDirection = new Vector3 (inputHandler.horizontal, 0f, inputHandler.vertical); 71 | Quaternion rollRotation = Quaternion.identity; 72 | if(movementDirection != Vector3.zero) 73 | { 74 | rollRotation = Quaternion.LookRotation(movementDirection); 75 | this.transform.rotation = rollRotation; 76 | } 77 | 78 | animator.SetBool("invulnerable", true); 79 | PlayTargetAnimation("Rolling", true); 80 | } 81 | } 82 | public void LookAt(Vector3 _lookPoint) 83 | { 84 | if(!animator.GetBool("canRotate")) 85 | return; 86 | 87 | lookPoint = _lookPoint; 88 | heightCorrectedPoint = new Vector3(lookPoint.x, transform.position.y, lookPoint.z); 89 | transform.LookAt(heightCorrectedPoint); 90 | } 91 | Vector3 heightCorrectedPoint; 92 | void OnDrawGizmosSelected() 93 | { 94 | // Draw a yellow sphere at the transform's position 95 | Gizmos.color = Color.red; 96 | Gizmos.DrawSphere(heightCorrectedPoint, 1); 97 | } 98 | public void UpdateAnimatorValues(float verticalMovement, float horizontalMovement)//, bool isSprinting) 99 | { 100 | Vector3 axisVector = new Vector3(horizontalMovement,0,verticalMovement); 101 | 102 | if (axisVector.magnitude > 0) 103 | { 104 | Vector3 normalizedLookingAt = lookPoint - transform.position; 105 | normalizedLookingAt.Normalize (); 106 | verticalMovement = Mathf.Clamp (Vector3.Dot (axisVector, normalizedLookingAt), -1, 1); 107 | 108 | Vector3 perpendicularLookingAt = new Vector3 (normalizedLookingAt.z, 0, -normalizedLookingAt.x); 109 | horizontalMovement = Mathf.Clamp (Vector3.Dot (axisVector, perpendicularLookingAt), -1, 1); 110 | 111 | // animator.SetBool("IsMoving", true); 112 | 113 | } else 114 | { 115 | animator.SetFloat(vertical, 0, 0.1f, Time.deltaTime); 116 | animator.SetFloat(horizontal, 0, 0.1f, Time.deltaTime); 117 | } 118 | 119 | // #region Vertical 120 | // float v = 0; 121 | // if (verticalMovement>0 && verticalMovement < 0.55f){ 122 | // v = 0.5f; 123 | // } 124 | // else if(verticalMovement>0.55f){ 125 | // v=1; 126 | // } 127 | // else if (verticalMovement<0&& verticalMovement> -0.55f){ 128 | // v = -0.5f; 129 | // } 130 | // else if (verticalMovement< -0.55f){ 131 | // v = -1; 132 | // } 133 | // else{ 134 | // v=0; 135 | // } 136 | // #endregion 137 | 138 | // #region Horizontal 139 | // float h = 0; 140 | // if (horizontalMovement>0 && horizontalMovement < 0.55f){ 141 | // h = 0.5f; 142 | // } 143 | // else if(horizontalMovement>0.55f){ 144 | // h=1; 145 | // } 146 | // else if (horizontalMovement<0&& horizontalMovement> -0.55f){ 147 | // v = -0.5f; 148 | // } 149 | // else if (horizontalMovement< -0.55f){ 150 | // h = -1; 151 | // } 152 | // else{ 153 | // h=0; 154 | // } 155 | // #endregion 156 | 157 | // if(isSprinting){ 158 | // v = 2; 159 | // h = horizontalMovement; 160 | // } 161 | // Vector3 localmove = transform.InverseTransformDirection(); 162 | // XMovement = localmove.x; 163 | // ZMovement = localmove.z; 164 | 165 | 166 | 167 | // update the animator parameters 168 | // animator.SetFloat ("Forward", forwardBackwardsMagnitude); 169 | // animator.SetFloat ("Right", rightLeftMagnitude); 170 | 171 | animator.SetFloat(vertical, verticalMovement, 0.1f, Time.deltaTime); 172 | animator.SetFloat(horizontal, horizontalMovement, 0.1f, Time.deltaTime); 173 | } 174 | public float forwardBackwardsMagnitude, rightLeftMagnitude; 175 | } 176 | -------------------------------------------------------------------------------- /Scripts/ScreenshotHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | public enum ImageFilterMode { 7 | Nearest = 0, 8 | Bilinear = 1, 9 | Average = 2 10 | } 11 | public class ScreenshotHandler : MonoBehaviour 12 | { 13 | private ScreenshotHandler instance; 14 | public Camera myCamera; 15 | private bool takeScreenshotOnNextFrame; 16 | public bool transparentBackground; 17 | public string filepath = "Assets/"; 18 | RenderTexture renderTexture; 19 | private void Awake() 20 | { 21 | instance = this; 22 | myCamera.backgroundColor = Color.black; 23 | } 24 | public IEnumerator onPostRender(string fileName) 25 | { 26 | yield return new WaitForEndOfFrame(); 27 | 28 | if(takeScreenshotOnNextFrame) 29 | { 30 | takeScreenshotOnNextFrame = false; 31 | renderTexture= myCamera.targetTexture; 32 | 33 | Texture2D renderResult = new Texture2D(renderTexture.width, renderTexture.height, TextureFormat.RGBA32, false); 34 | 35 | //used to be 0,0 for bottom left corner, moving it to get center of screen, should have probably just made the screen size 512 by 512 36 | Rect rect = new Rect((512-renderTexture.width)/2, (512-renderTexture.height)/2, renderTexture.width, renderTexture.height); 37 | renderResult.ReadPixels(rect, 0, 0); 38 | 39 | if(transparentBackground) 40 | renderResult = RemoveBackground(renderResult); 41 | 42 | renderResult = ResizeTexture(renderResult, ImageFilterMode.Average, renderTexture.width, renderTexture.height); 43 | 44 | byte[] byteArray = renderResult.EncodeToPNG(); 45 | System.IO.File.WriteAllBytes(filepath + fileName +".png", byteArray); 46 | RenderTexture.ReleaseTemporary(renderTexture); 47 | myCamera.targetTexture = null; 48 | Debug.Log(filepath + fileName + ".png created"); 49 | } 50 | } 51 | private Texture2D RemoveBackground(Texture2D renderResult) 52 | { 53 | Color[] pixels = renderResult.GetPixels(0, 0, renderTexture.width, renderTexture.height); 54 | for (int i = 0; i < pixels.Length; i++) 55 | { 56 | if (pixels[i] == Color.black) 57 | { 58 | pixels[i] = Color.clear; 59 | } 60 | } 61 | renderResult.SetPixels(0, 0, renderTexture.width, renderTexture.height, pixels); 62 | renderResult.Apply(); 63 | 64 | return renderResult; 65 | } 66 | public void TakeScreenshot(int width, int height, string fileName) 67 | { 68 | myCamera.targetTexture = RenderTexture.GetTemporary(width, height, 32); 69 | takeScreenshotOnNextFrame = true; 70 | StartCoroutine(onPostRender(fileName)); 71 | } 72 | public Texture2D ResizeTexture(Texture2D originalTexture, ImageFilterMode filterMode, int newWidth, int newHeight) 73 | { 74 | //*** Get All the source pixels 75 | Color[] sourceColor = originalTexture.GetPixels(0); 76 | Vector2 sourceSize = new Vector2(originalTexture.width, originalTexture.height); 77 | 78 | //*** Calculate New Size 79 | float textureWidth = newWidth; 80 | float textureHeight = newHeight; 81 | 82 | //*** Make New 83 | Texture2D newTexture = new Texture2D((int)textureWidth, (int)textureHeight, TextureFormat.RGBA32, false); 84 | 85 | //*** Make destination array 86 | Color[] aColor = new Color[(int)textureWidth * (int)textureHeight]; 87 | 88 | Vector2 pixelSize = new Vector2(sourceSize.x / textureWidth, sourceSize.y / textureHeight); 89 | 90 | //*** Loop through destination pixels and process 91 | Vector2 center = new Vector2(); 92 | for (int i = 0; i < aColor.Length; i++) { 93 | 94 | //*** Figure out x&y 95 | float x = (float)i % textureWidth; 96 | float y = Mathf.Floor((float)i / textureWidth); 97 | 98 | //*** Calculate Center 99 | center.x = (x / textureWidth) * sourceSize.x; 100 | center.y = (y / textureHeight) * sourceSize.y; 101 | 102 | //*** Do Based on mode 103 | //*** Nearest neighbour (testing) 104 | if (filterMode == ImageFilterMode.Nearest) { 105 | 106 | //*** Nearest neighbour (testing) 107 | center.x = Mathf.Round(center.x); 108 | center.y = Mathf.Round(center.y); 109 | 110 | //*** Calculate source index 111 | int sourceIndex = (int)((center.y * sourceSize.x) + center.x); 112 | 113 | //*** Copy Pixel 114 | aColor[i] = sourceColor[sourceIndex]; 115 | } 116 | 117 | //*** Bilinear 118 | else if (filterMode == ImageFilterMode.Bilinear) { 119 | 120 | //*** Get Ratios 121 | float ratioX = center.x - Mathf.Floor(center.x); 122 | float ratioY = center.y - Mathf.Floor(center.y); 123 | 124 | //*** Get Pixel index's 125 | int indexTL = (int)((Mathf.Floor(center.y) * sourceSize.x) + Mathf.Floor(center.x)); 126 | int indexTR = (int)((Mathf.Floor(center.y) * sourceSize.x) + Mathf.Ceil(center.x)); 127 | int indexBL = (int)((Mathf.Ceil(center.y) * sourceSize.x) + Mathf.Floor(center.x)); 128 | int indexBR = (int)((Mathf.Ceil(center.y) * sourceSize.x) + Mathf.Ceil(center.x)); 129 | 130 | //*** Calculate Color 131 | aColor[i] = Color.Lerp( 132 | Color.Lerp(sourceColor[indexTL], sourceColor[indexTR], ratioX), 133 | Color.Lerp(sourceColor[indexBL], sourceColor[indexBR], ratioX), 134 | ratioY 135 | ); 136 | } 137 | 138 | //*** Average 139 | else if (filterMode == ImageFilterMode.Average) { 140 | 141 | //*** Calculate grid around point 142 | int xFrom = (int)Mathf.Max(Mathf.Floor(center.x - (pixelSize.x * 0.5f)), 0); 143 | int xTo = (int)Mathf.Min(Mathf.Ceil(center.x + (pixelSize.x * 0.5f)), sourceSize.x); 144 | int yFrom = (int)Mathf.Max(Mathf.Floor(center.y - (pixelSize.y * 0.5f)), 0); 145 | int yTo = (int)Mathf.Min(Mathf.Ceil(center.y + (pixelSize.y * 0.5f)), sourceSize.y); 146 | 147 | //*** Loop and accumulate 148 | Color tempColor = new Color(); 149 | float xGridCount = 0; 150 | for (int iy = yFrom; iy < yTo; iy++) { 151 | for (int ix = xFrom; ix < xTo; ix++) { 152 | 153 | //*** Get Color 154 | tempColor += sourceColor[(int)(((float)iy * sourceSize.x) + ix)]; 155 | 156 | //*** Sum 157 | xGridCount++; 158 | } 159 | } 160 | 161 | //*** Average Color 162 | aColor[i] = tempColor / (float)xGridCount; 163 | } 164 | } 165 | 166 | //*** Set Pixels 167 | newTexture.SetPixels(aColor); 168 | newTexture.Apply(); 169 | 170 | //*** Return 171 | return newTexture; 172 | } 173 | } -------------------------------------------------------------------------------- /Scripts/Map/SerializableDictionary/SerializableDictionary.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Runtime.Serialization; 5 | using UnityEngine; 6 | 7 | public abstract class SerializableDictionaryBase 8 | { 9 | public abstract class Storage {} 10 | 11 | protected class Dictionary : System.Collections.Generic.Dictionary 12 | { 13 | public Dictionary() {} 14 | public Dictionary(IDictionary dict) : base(dict) {} 15 | public Dictionary(SerializationInfo info, StreamingContext context) : base(info, context) {} 16 | } 17 | } 18 | 19 | [Serializable] 20 | public abstract class SerializableDictionaryBase : SerializableDictionaryBase, IDictionary, IDictionary, ISerializationCallbackReceiver, IDeserializationCallback, ISerializable 21 | { 22 | Dictionary m_dict; 23 | [SerializeField] 24 | TKey[] m_keys; 25 | [SerializeField] 26 | TValueStorage[] m_values; 27 | 28 | public SerializableDictionaryBase() 29 | { 30 | m_dict = new Dictionary(); 31 | } 32 | 33 | public SerializableDictionaryBase(IDictionary dict) 34 | { 35 | m_dict = new Dictionary(dict); 36 | } 37 | 38 | protected abstract void SetValue(TValueStorage[] storage, int i, TValue value); 39 | protected abstract TValue GetValue(TValueStorage[] storage, int i); 40 | 41 | public void CopyFrom(IDictionary dict) 42 | { 43 | m_dict.Clear(); 44 | foreach (var kvp in dict) 45 | { 46 | m_dict[kvp.Key] = kvp.Value; 47 | } 48 | } 49 | 50 | public void OnAfterDeserialize() 51 | { 52 | if(m_keys != null && m_values != null && m_keys.Length == m_values.Length) 53 | { 54 | m_dict.Clear(); 55 | int n = m_keys.Length; 56 | for(int i = 0; i < n; ++i) 57 | { 58 | m_dict[m_keys[i]] = GetValue(m_values, i); 59 | } 60 | 61 | m_keys = null; 62 | m_values = null; 63 | } 64 | } 65 | 66 | public void OnBeforeSerialize() 67 | { 68 | int n = m_dict.Count; 69 | m_keys = new TKey[n]; 70 | m_values = new TValueStorage[n]; 71 | 72 | int i = 0; 73 | foreach(var kvp in m_dict) 74 | { 75 | m_keys[i] = kvp.Key; 76 | SetValue(m_values, i, kvp.Value); 77 | ++i; 78 | } 79 | } 80 | 81 | #region IDictionary 82 | 83 | public ICollection Keys { get { return ((IDictionary)m_dict).Keys; } } 84 | public ICollection Values { get { return ((IDictionary)m_dict).Values; } } 85 | public int Count { get { return ((IDictionary)m_dict).Count; } } 86 | public bool IsReadOnly { get { return ((IDictionary)m_dict).IsReadOnly; } } 87 | 88 | public TValue this[TKey key] 89 | { 90 | get { return ((IDictionary)m_dict)[key]; } 91 | set { ((IDictionary)m_dict)[key] = value; } 92 | } 93 | 94 | public void Add(TKey key, TValue value) 95 | { 96 | ((IDictionary)m_dict).Add(key, value); 97 | } 98 | 99 | public bool ContainsKey(TKey key) 100 | { 101 | return ((IDictionary)m_dict).ContainsKey(key); 102 | } 103 | 104 | public bool Remove(TKey key) 105 | { 106 | return ((IDictionary)m_dict).Remove(key); 107 | } 108 | 109 | public bool TryGetValue(TKey key, out TValue value) 110 | { 111 | return ((IDictionary)m_dict).TryGetValue(key, out value); 112 | } 113 | 114 | public void Add(KeyValuePair item) 115 | { 116 | ((IDictionary)m_dict).Add(item); 117 | } 118 | 119 | public void Clear() 120 | { 121 | ((IDictionary)m_dict).Clear(); 122 | } 123 | 124 | public bool Contains(KeyValuePair item) 125 | { 126 | return ((IDictionary)m_dict).Contains(item); 127 | } 128 | 129 | public void CopyTo(KeyValuePair[] array, int arrayIndex) 130 | { 131 | ((IDictionary)m_dict).CopyTo(array, arrayIndex); 132 | } 133 | 134 | public bool Remove(KeyValuePair item) 135 | { 136 | return ((IDictionary)m_dict).Remove(item); 137 | } 138 | 139 | public IEnumerator> GetEnumerator() 140 | { 141 | return ((IDictionary)m_dict).GetEnumerator(); 142 | } 143 | 144 | IEnumerator IEnumerable.GetEnumerator() 145 | { 146 | return ((IDictionary)m_dict).GetEnumerator(); 147 | } 148 | 149 | #endregion 150 | 151 | #region IDictionary 152 | 153 | public bool IsFixedSize { get { return ((IDictionary)m_dict).IsFixedSize; } } 154 | ICollection IDictionary.Keys { get { return ((IDictionary)m_dict).Keys; } } 155 | ICollection IDictionary.Values { get { return ((IDictionary)m_dict).Values; } } 156 | public bool IsSynchronized { get { return ((IDictionary)m_dict).IsSynchronized; } } 157 | public object SyncRoot { get { return ((IDictionary)m_dict).SyncRoot; } } 158 | 159 | public object this[object key] 160 | { 161 | get { return ((IDictionary)m_dict)[key]; } 162 | set { ((IDictionary)m_dict)[key] = value; } 163 | } 164 | 165 | public void Add(object key, object value) 166 | { 167 | ((IDictionary)m_dict).Add(key, value); 168 | } 169 | 170 | public bool Contains(object key) 171 | { 172 | return ((IDictionary)m_dict).Contains(key); 173 | } 174 | 175 | IDictionaryEnumerator IDictionary.GetEnumerator() 176 | { 177 | return ((IDictionary)m_dict).GetEnumerator(); 178 | } 179 | 180 | public void Remove(object key) 181 | { 182 | ((IDictionary)m_dict).Remove(key); 183 | } 184 | 185 | public void CopyTo(Array array, int index) 186 | { 187 | ((IDictionary)m_dict).CopyTo(array, index); 188 | } 189 | 190 | #endregion 191 | 192 | #region IDeserializationCallback 193 | 194 | public void OnDeserialization(object sender) 195 | { 196 | ((IDeserializationCallback)m_dict).OnDeserialization(sender); 197 | } 198 | 199 | #endregion 200 | 201 | #region ISerializable 202 | 203 | protected SerializableDictionaryBase(SerializationInfo info, StreamingContext context) 204 | { 205 | m_dict = new Dictionary(info, context); 206 | } 207 | 208 | public void GetObjectData(SerializationInfo info, StreamingContext context) 209 | { 210 | ((ISerializable)m_dict).GetObjectData(info, context); 211 | } 212 | 213 | #endregion 214 | } 215 | 216 | public static class SerializableDictionary 217 | { 218 | public class Storage : SerializableDictionaryBase.Storage 219 | { 220 | public T data; 221 | } 222 | } 223 | 224 | [Serializable] 225 | public class SerializableDictionary : SerializableDictionaryBase 226 | { 227 | public SerializableDictionary() {} 228 | public SerializableDictionary(IDictionary dict) : base(dict) {} 229 | protected SerializableDictionary(SerializationInfo info, StreamingContext context) : base(info, context) {} 230 | 231 | protected override TValue GetValue(TValue[] storage, int i) 232 | { 233 | return storage[i]; 234 | } 235 | 236 | protected override void SetValue(TValue[] storage, int i, TValue value) 237 | { 238 | storage[i] = value; 239 | } 240 | } 241 | 242 | [Serializable] 243 | public class SerializableDictionary : SerializableDictionaryBase where TValueStorage : SerializableDictionary.Storage, new() 244 | { 245 | public SerializableDictionary() {} 246 | public SerializableDictionary(IDictionary dict) : base(dict) {} 247 | protected SerializableDictionary(SerializationInfo info, StreamingContext context) : base(info, context) {} 248 | 249 | protected override TValue GetValue(TValueStorage[] storage, int i) 250 | { 251 | return storage[i].data; 252 | } 253 | 254 | protected override void SetValue(TValueStorage[] storage, int i, TValue value) 255 | { 256 | storage[i] = new TValueStorage(); 257 | storage[i].data = value; 258 | } 259 | } 260 | -------------------------------------------------------------------------------- /Scripts/Player/Sandevistan.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | 6 | public class Sandevistan : MonoBehaviour 7 | { 8 | [Header("Graphics Transition")] 9 | public float transitionTime; 10 | public static Sandevistan instance; 11 | public Volume sandyVolume, mainVolume; 12 | public Camera mainCamera; 13 | 14 | [Header("Sandevistan Active")] 15 | 16 | [SerializeField] private float activeTime, meshRefreshRate = 0.1f, meshDestroyDelay = 3f; 17 | [SerializeField] private SkinnedMeshRenderer[] skinnedMeshRenderer; 18 | [SerializeField] private List spawnedMeshes; 19 | public Transform positionToSpawnAt; 20 | 21 | [Header ("Shader Related")] 22 | public Material mat; 23 | public string shaderVarRef; 24 | public float shaderVarRate = 0.1f, shaderVarRefreshRate = 0.05f; 25 | 26 | [Header("Color change")] 27 | [SerializeField] private Color[] mycolors; 28 | [SerializeField] private float lerpTime; 29 | int colorIndex = 0, len; 30 | float t = 0f; 31 | private Color sandyColor; 32 | public bool sandevistanActive; 33 | public bool OnCoolDown; 34 | public List sandevistanObjects; 35 | 36 | private void Awake() 37 | { 38 | instance = this; 39 | } 40 | 41 | void Start() 42 | { 43 | len = mycolors.Length; 44 | CreateCopiesPool(); 45 | } 46 | 47 | // Update is called once per frame 48 | void Update() 49 | { 50 | sandyColor = Color.Lerp(sandyColor, mycolors[colorIndex], lerpTime * Time.deltaTime); 51 | t = Mathf.Lerp(t, 1, lerpTime * Time.deltaTime); 52 | 53 | if(t > 0.9f) 54 | { 55 | t = 0; 56 | colorIndex++; 57 | colorIndex = (colorIndex == mycolors.Length) ? 0 : colorIndex; 58 | } 59 | } 60 | public IEnumerator ActivateSandy() 61 | { 62 | OnCoolDown = true; 63 | sandevistanActive = true; 64 | float timeActive = activeTime; 65 | 66 | PlayerManager.instance.uIManager.RechargeCyberUpgradeUI(CyberwareType.Sandevistan); 67 | StartCoroutine(ControlMainVolume(1, 0f, transitionTime)); 68 | StartCoroutine(ControlSandyVolume(0, 1f, transitionTime)); 69 | StartCoroutine(ControlCameraFOV(60f, 50f, transitionTime)); 70 | 71 | while (timeActive > 0) 72 | { 73 | timeActive -= meshRefreshRate; 74 | 75 | if(skinnedMeshRenderer==null) 76 | skinnedMeshRenderer = GetComponentsInChildren(); 77 | 78 | for(int i = 0; i < skinnedMeshRenderer.Length; i++) 79 | { 80 | GameObject gObj = GetCopyFromPool(); 81 | gObj.SetActive(true); 82 | gObj.transform.SetPositionAndRotation(positionToSpawnAt.position, positionToSpawnAt.rotation); 83 | 84 | MeshRenderer mr = gObj.GetComponent(); 85 | MeshFilter mf = gObj.GetComponent(); 86 | 87 | Mesh mesh = new Mesh(); 88 | skinnedMeshRenderer[i].BakeMesh(mesh); 89 | 90 | mf.mesh = mesh; 91 | mr.material = mat; 92 | mr.material.color = sandyColor; 93 | spawnedMeshes.Add(gObj); 94 | 95 | StartCoroutine(AnimateMaterialFloat(mr.material, 0, shaderVarRate, shaderVarRefreshRate)); 96 | } 97 | yield return new WaitForSeconds(meshRefreshRate); 98 | } 99 | 100 | foreach(GameObject playerCopy in spawnedMeshes) 101 | playerCopy.SetActive(false); 102 | 103 | spawnedMeshes.Clear(); 104 | 105 | sandevistanActive = false; 106 | StartCoroutine(ControlMainVolume(0, 1f, transitionTime)); 107 | StartCoroutine(ControlSandyVolume(1, 0f, transitionTime)); 108 | StartCoroutine(ControlCameraFOV(50, 60f, transitionTime)); 109 | } 110 | private void CreateCopiesPool() 111 | { 112 | for(int i = 0; i < 50; i++) 113 | { 114 | GameObject playerCopy = new GameObject(); 115 | playerCopy.name = "PlayerCopy"; 116 | MeshRenderer mr = playerCopy.AddComponent(); 117 | mr.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; 118 | MeshFilter mf = playerCopy.AddComponent(); 119 | playerCopy.SetActive(false); 120 | sandevistanObjects.Add(playerCopy); 121 | } 122 | } 123 | public GameObject GetCopyFromPool() 124 | { 125 | foreach(GameObject playerCopy in sandevistanObjects) 126 | { 127 | if (!playerCopy.activeInHierarchy) 128 | return playerCopy; 129 | } 130 | return null; 131 | } 132 | 133 | private IEnumerator AnimateMaterialFloat(Material mat, float goal, float rate, float rerfreshRate) 134 | { 135 | float valueToAnimate = mat.GetFloat(shaderVarRef); 136 | while(valueToAnimate > goal) 137 | { 138 | valueToAnimate -= rate; 139 | mat.SetFloat(shaderVarRef, valueToAnimate); 140 | yield return new WaitForSeconds(rerfreshRate); 141 | } 142 | } 143 | private void SetColor(MeshRenderer mr, Color color) 144 | { 145 | mr.material.color = color; 146 | } 147 | private Color CurrentColor() 148 | { 149 | return Color.Lerp(mycolors[0], mycolors[1], t); 150 | } 151 | private IEnumerator ControlSandyVolume(float startValue, float endValue, float lerpDuration) 152 | { 153 | float currentLerpTime = 0f, lerpValue = 0f; 154 | 155 | while (sandyVolume.weight != endValue) 156 | { 157 | currentLerpTime += Time.deltaTime; 158 | 159 | if (currentLerpTime < lerpDuration) 160 | { 161 | lerpValue = Mathf.Lerp(startValue, endValue, currentLerpTime / lerpDuration); 162 | } 163 | else 164 | { 165 | lerpValue = endValue; 166 | } 167 | 168 | sandyVolume.weight = lerpValue; 169 | yield return null; 170 | } 171 | } 172 | private IEnumerator ControlMainVolume(float startValue, float endValue, float lerpDuration) 173 | { 174 | float currentLerpTime = 0f, lerpValue = 0f; 175 | 176 | while (mainVolume.weight != endValue) 177 | { 178 | currentLerpTime += Time.deltaTime; 179 | 180 | if (currentLerpTime < lerpDuration) 181 | { 182 | lerpValue = Mathf.Lerp(startValue, endValue, currentLerpTime / lerpDuration); 183 | } 184 | else 185 | { 186 | lerpValue = endValue; 187 | } 188 | 189 | mainVolume.weight = lerpValue; 190 | yield return null; 191 | } 192 | } 193 | private IEnumerator ControlCameraFOV(float startValue, float endValue, float lerpDuration) 194 | { 195 | float currentLerpTime = 0f, lerpValue = 0f; 196 | 197 | while (mainCamera.fieldOfView != endValue) 198 | { 199 | currentLerpTime += Time.deltaTime; 200 | 201 | if (currentLerpTime < lerpDuration) 202 | { 203 | lerpValue = Mathf.Lerp(startValue, endValue, currentLerpTime / lerpDuration); 204 | } 205 | else 206 | { 207 | lerpValue = endValue; 208 | } 209 | 210 | mainCamera.fieldOfView = lerpValue; 211 | yield return null; 212 | } 213 | } 214 | } 215 | -------------------------------------------------------------------------------- /Scripts/FadeObjectBlockingObject.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class FadeObjectBlockingObject : MonoBehaviour 6 | { 7 | [SerializeField] 8 | private LayerMask LayerMask; 9 | [SerializeField] 10 | private Transform Target; 11 | [SerializeField] 12 | private Camera Camera; 13 | [SerializeField] 14 | [Range(0, 1f)] 15 | private float FadedAlpha = 0.33f; 16 | [SerializeField] 17 | private bool RetainShadows = true; 18 | [SerializeField] 19 | private Vector3 TargetPositionOffset = Vector3.up; 20 | [SerializeField] 21 | private float FadeSpeed = 1; 22 | 23 | [Header("Read Only Data")] 24 | [SerializeField] 25 | private List ObjectsBlockingView = new List(); 26 | private Dictionary RunningCoroutines = new Dictionary(); 27 | 28 | private RaycastHit[] Hits = new RaycastHit[10]; 29 | 30 | private void OnEnable() 31 | { 32 | StartCoroutine(CheckForObjects()); 33 | } 34 | 35 | private IEnumerator CheckForObjects() 36 | { 37 | while (true) 38 | { 39 | int hits = Physics.RaycastNonAlloc( 40 | Camera.transform.position, 41 | (Target.transform.position + TargetPositionOffset - Camera.transform.position).normalized, 42 | Hits, 43 | Vector3.Distance(Camera.transform.position, Target.transform.position + TargetPositionOffset), 44 | LayerMask 45 | ); 46 | 47 | if (hits > 0) 48 | { 49 | for (int i = 0; i < hits; i++) 50 | { 51 | FadingObject fadingObject = GetFadingObjectFromHit(Hits[i]); 52 | 53 | if (fadingObject != null && !ObjectsBlockingView.Contains(fadingObject)) 54 | { 55 | if (RunningCoroutines.ContainsKey(fadingObject)) 56 | { 57 | if (RunningCoroutines[fadingObject] != null) 58 | { 59 | StopCoroutine(RunningCoroutines[fadingObject]); 60 | } 61 | 62 | RunningCoroutines.Remove(fadingObject); 63 | } 64 | 65 | RunningCoroutines.Add(fadingObject, StartCoroutine(FadeObjectOut(fadingObject))); 66 | ObjectsBlockingView.Add(fadingObject); 67 | } 68 | } 69 | } 70 | 71 | FadeObjectsNoLongerBeingHit(); 72 | 73 | ClearHits(); 74 | 75 | yield return null; 76 | } 77 | } 78 | 79 | private void FadeObjectsNoLongerBeingHit() 80 | { 81 | List objectsToRemove = new List(ObjectsBlockingView.Count); 82 | 83 | foreach (FadingObject fadingObject in ObjectsBlockingView) 84 | { 85 | bool objectIsBeingHit = false; 86 | for (int i = 0; i < Hits.Length; i++) 87 | { 88 | FadingObject hitFadingObject = GetFadingObjectFromHit(Hits[i]); 89 | if (hitFadingObject != null && fadingObject == hitFadingObject) 90 | { 91 | objectIsBeingHit = true; 92 | break; 93 | } 94 | } 95 | 96 | if (!objectIsBeingHit) 97 | { 98 | if (RunningCoroutines.ContainsKey(fadingObject)) 99 | { 100 | if (RunningCoroutines[fadingObject] != null) 101 | { 102 | StopCoroutine(RunningCoroutines[fadingObject]); 103 | } 104 | RunningCoroutines.Remove(fadingObject); 105 | } 106 | 107 | RunningCoroutines.Add(fadingObject, StartCoroutine(FadeObjectIn(fadingObject))); 108 | objectsToRemove.Add(fadingObject); 109 | } 110 | } 111 | 112 | foreach(FadingObject removeObject in objectsToRemove) 113 | { 114 | ObjectsBlockingView.Remove(removeObject); 115 | } 116 | } 117 | 118 | private IEnumerator FadeObjectOut(FadingObject FadingObject) 119 | { 120 | foreach (Material material in FadingObject.Materials) 121 | { 122 | material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha); 123 | material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha); 124 | material.SetInt("_ZWrite", 0); 125 | material.SetInt("_Surface", 1); 126 | 127 | material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent; 128 | 129 | material.SetShaderPassEnabled("DepthOnly", false); 130 | material.SetShaderPassEnabled("SHADOWCASTER", RetainShadows); 131 | 132 | material.SetOverrideTag("RenderType", "Transparent"); 133 | 134 | material.EnableKeyword("_SURFACE_TYPE_TRANSPARENT"); 135 | material.EnableKeyword("_ALPHAPREMULTIPLY_ON"); 136 | } 137 | 138 | float time = 0; 139 | 140 | while (FadingObject.Materials[0].color.a > FadedAlpha) 141 | { 142 | foreach (Material material in FadingObject.Materials) 143 | { 144 | if (material.HasProperty("_Color")) 145 | { 146 | material.color = new Color( 147 | material.color.r, 148 | material.color.g, 149 | material.color.b, 150 | Mathf.Lerp(FadingObject.InitialAlpha, FadedAlpha, time * FadeSpeed) 151 | ); 152 | } 153 | } 154 | 155 | time += Time.deltaTime; 156 | yield return null; 157 | } 158 | 159 | if (RunningCoroutines.ContainsKey(FadingObject)) 160 | { 161 | StopCoroutine(RunningCoroutines[FadingObject]); 162 | RunningCoroutines.Remove(FadingObject); 163 | } 164 | } 165 | 166 | private IEnumerator FadeObjectIn(FadingObject FadingObject) 167 | { 168 | float time = 0; 169 | 170 | while (FadingObject.Materials[0].color.a < FadingObject.InitialAlpha) 171 | { 172 | foreach (Material material in FadingObject.Materials) 173 | { 174 | if (material.HasProperty("_Color")) 175 | { 176 | material.color = new Color( 177 | material.color.r, 178 | material.color.g, 179 | material.color.b, 180 | Mathf.Lerp(FadedAlpha, FadingObject.InitialAlpha, time * FadeSpeed) 181 | ); 182 | } 183 | } 184 | 185 | time += Time.deltaTime; 186 | yield return null; 187 | } 188 | 189 | foreach (Material material in FadingObject.Materials) 190 | { 191 | material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One); 192 | material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero); 193 | material.SetInt("_ZWrite", 1); 194 | material.SetInt("_Surface", 0); 195 | 196 | material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Geometry; 197 | 198 | material.SetShaderPassEnabled("DepthOnly", true); 199 | material.SetShaderPassEnabled("SHADOWCASTER", true); 200 | 201 | material.SetOverrideTag("RenderType", "Opaque"); 202 | 203 | material.DisableKeyword("_SURFACE_TYPE_TRANSPARENT"); 204 | material.DisableKeyword("_ALPHAPREMULTIPLY_ON"); 205 | } 206 | 207 | if (RunningCoroutines.ContainsKey(FadingObject)) 208 | { 209 | StopCoroutine(RunningCoroutines[FadingObject]); 210 | RunningCoroutines.Remove(FadingObject); 211 | } 212 | } 213 | 214 | private void ClearHits() 215 | { 216 | System.Array.Clear(Hits, 0, Hits.Length); 217 | } 218 | 219 | private FadingObject GetFadingObjectFromHit(RaycastHit Hit) 220 | { 221 | return Hit.collider != null ? Hit.collider.GetComponent() : null; 222 | } 223 | 224 | } 225 | -------------------------------------------------------------------------------- /Scripts/Player/PlayerStats.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using TJAudio; 5 | 6 | public class PlayerStats : MonoBehaviour 7 | { 8 | [SerializeField] private MetaProgressionSO maxHealthSO; 9 | [SerializeField] private MetaProgressionSO healthRegenSO, moveSpeedSO, reloadSpeedSO, rollChargesSO; 10 | 11 | [Header("Meta Progression")] 12 | [SerializeField] private StatStructure baseHealth; 13 | [SerializeField] private StatStructure healthRegenRate, moveSpeed, reloadSpeed, rollCharges; 14 | public float BaseHealth => baseHealth.activeStat; 15 | public float HealthRegenRate => healthRegenRate.activeStat; 16 | public float MoveSpeed => moveSpeed.activeStat; 17 | public float ReloadSpeed => reloadSpeed.activeStat; 18 | public float RollCharges => rollCharges.activeStat; 19 | 20 | [Header("Other Stats")] 21 | [SerializeField] private StatStructure pickUpRadius; 22 | [SerializeField] private StatStructure upgradesToDraw, rateOfFire, rollChargeRate, sandevistanRechargeRate, 23 | angelFireRechargeRate, expMultiplier, critChance, critDamage, projectilePiercing, armor, bonusHealth; 24 | public float PickUpRadius => pickUpRadius.activeStat; 25 | public float UpgradesToDraw => upgradesToDraw.activeStat; 26 | public float RateOfFire => rateOfFire.activeStat; 27 | public float RollChargeRate => rollChargeRate.activeStat; 28 | public float SandevistanRechargeRate => sandevistanRechargeRate.activeStat; 29 | public float AngelFireRechargeRate => angelFireRechargeRate.activeStat; 30 | public float ExpMultiplier => expMultiplier.activeStat; 31 | public float CritChance => critChance.activeStat; 32 | public float CritDamage => critDamage.activeStat; 33 | public float ProjectilePiercing => projectilePiercing.activeStat; 34 | public float Armor => armor.activeStat; 35 | public float BonusHealth => bonusHealth.activeStat; 36 | 37 | [Header("Exp")] 38 | [SerializeField] private float exp; 39 | public float Exp => exp; 40 | public float currentExp; 41 | public ExpLevel expLevel; 42 | 43 | [SerializeField] private PlayerUI playerUI; 44 | 45 | [Header("Random Stats")] 46 | public float WeaponSlots = 1; 47 | public float healthRegenSpeedMultiplier = 1f; 48 | PlayerManager playerManager; 49 | UIManager uIManager; 50 | List statStructures = new List(); 51 | 52 | private void Start() 53 | { 54 | playerManager = GetComponent(); 55 | uIManager = PlayerManager.instance.uIManager; 56 | 57 | List metaProgressionContainers = GameManager.instance.metaProgressionManager.LoadMetaProgression(); 58 | ApplyMetaProgressionStats(metaProgressionContainers); 59 | 60 | statStructures.Add(baseHealth); 61 | statStructures.Add(healthRegenRate); 62 | statStructures.Add(moveSpeed); 63 | statStructures.Add(reloadSpeed); 64 | statStructures.Add(rollCharges); 65 | 66 | statStructures.Add(pickUpRadius); 67 | statStructures.Add(upgradesToDraw); 68 | statStructures.Add(rateOfFire); 69 | statStructures.Add(upgradesToDraw); 70 | statStructures.Add(rateOfFire); 71 | statStructures.Add(rollChargeRate); 72 | statStructures.Add(sandevistanRechargeRate); 73 | statStructures.Add(angelFireRechargeRate); 74 | statStructures.Add(expMultiplier); 75 | statStructures.Add(critChance); 76 | statStructures.Add(critDamage); 77 | statStructures.Add(projectilePiercing); 78 | statStructures.Add(armor); 79 | statStructures.Add(bonusHealth); 80 | 81 | SetUpStatStructures(); 82 | uIManager.CreateRollCharges(); 83 | uIManager.PauseForUpgrade(); 84 | } 85 | private void SetUpStatStructures() 86 | { 87 | foreach(StatStructure statStructure in statStructures) 88 | statStructure.SetUp(); 89 | } 90 | private void ApplyMetaProgressionStats(List metaProgressionContainers) 91 | { 92 | foreach(MetaProgressionContainer metaProgressionContainer in metaProgressionContainers) 93 | { 94 | if(metaProgressionContainer.metaProgressionSO == maxHealthSO) 95 | { 96 | // Debug.Log($"found max health {metaProgressionContainer.GetHighestUnlockedLevel(metaProgressionContainer.metaProgressionSO)}"); 97 | baseHealth.baseStat = metaProgressionContainer.GetHighestUnlockedLevel(metaProgressionContainer.metaProgressionSO); 98 | // maxHealth.activeStat = maxHealth.baseStat; 99 | } 100 | else if(metaProgressionContainer.metaProgressionSO == healthRegenSO) 101 | { 102 | // Debug.Log($"found health regen {metaProgressionContainer.GetHighestUnlockedLevel(metaProgressionContainer.metaProgressionSO)}"); 103 | healthRegenRate.modifierStat = metaProgressionContainer.GetHighestUnlockedLevel(metaProgressionContainer.metaProgressionSO); 104 | // healthRegen.activeStat = healthRegen.baseStat; 105 | } 106 | else if(metaProgressionContainer.metaProgressionSO == moveSpeedSO) 107 | { 108 | // Debug.Log($"found move speed {metaProgressionContainer.GetHighestUnlockedLevel(metaProgressionContainer.metaProgressionSO)}"); 109 | moveSpeed.modifierStat = metaProgressionContainer.GetHighestUnlockedLevel(metaProgressionContainer.metaProgressionSO); 110 | // moveSpeed.activeStat = moveSpeed.baseStat; 111 | } 112 | else if(metaProgressionContainer.metaProgressionSO == reloadSpeedSO) 113 | { 114 | // Debug.Log($"found reload speed {metaProgressionContainer.GetHighestUnlockedLevel(metaProgressionContainer.metaProgressionSO)}"); 115 | reloadSpeed.modifierStat = metaProgressionContainer.GetHighestUnlockedLevel(metaProgressionContainer.metaProgressionSO); 116 | // reloadSpeed.activeStat = reloadSpeed.baseStat; 117 | } 118 | else if(metaProgressionContainer.metaProgressionSO == rollChargesSO) 119 | { 120 | // Debug.Log($"found roll charges {metaProgressionContainer.GetHighestUnlockedLevel(metaProgressionContainer.metaProgressionSO)}"); 121 | rollCharges.modifierStat = metaProgressionContainer.GetHighestUnlockedLevel(metaProgressionContainer.metaProgressionSO); 122 | } 123 | } 124 | } 125 | public void ApplyUpgrade(ActiveUpgrades activeUpgrade) 126 | { 127 | foreach(StatStructure statStructure in statStructures) 128 | { 129 | if(statStructure.upgrade == activeUpgrade.upgrade) 130 | { 131 | statStructure.Modify(activeUpgrade); 132 | break; 133 | } 134 | } 135 | uIManager.UnpauseAfterUpgrade(); 136 | } 137 | public void GainExp(float amount) 138 | { 139 | exp += amount; 140 | playerUI.DisplayExp(); 141 | 142 | if(exp>=expLevel.maxExp) 143 | { 144 | LevelUp(); 145 | playerUI.UpdateExpBar(); 146 | } 147 | } 148 | private void LevelUp() 149 | { 150 | expLevel.levelNumber++; 151 | expLevel.minExp = expLevel.maxExp; 152 | expLevel.maxExp += (expLevel.levelExpIncrease * expLevel.levelNumber); 153 | uIManager.PauseForUpgrade(); 154 | IAudioRequester.instance.PlaySFX("levelUp"); 155 | } 156 | } 157 | [System.Serializable] public struct ExpLevel 158 | { 159 | public float levelNumber; 160 | public float minExp, maxExp; 161 | public float levelExpIncrease; 162 | } 163 | [System.Serializable] public class ActiveUpgrades 164 | { 165 | public Upgrade upgrade; 166 | public int level; 167 | } 168 | 169 | [System.Serializable] public class StatStructure 170 | { 171 | public Upgrade upgrade; 172 | public float baseStat = 1; 173 | public float activeStat = 1; 174 | public float modifierStat = 1; 175 | 176 | public void Modify(ActiveUpgrades upgradeStructure) 177 | { 178 | if(upgradeStructure.upgrade.upgradeType == Upgrade.UpgradeType.weapon) 179 | { 180 | 181 | } 182 | else if(upgradeStructure.upgrade.upgradeType == Upgrade.UpgradeType.stat) 183 | { 184 | modifierStat = upgradeStructure.upgrade.upgradlevels[upgradeStructure.level].upgradeModifier; 185 | activeStat = baseStat * modifierStat; 186 | } 187 | } 188 | public void SetUp() 189 | { 190 | activeStat = baseStat * modifierStat; 191 | } 192 | } 193 | --------------------------------------------------------------------------------