diff --git a/.gitignore b/.gitignore index eb83a8f..78beb69 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,36 @@ +# This .gitignore file should be placed at the root of your Unity project directory +# +# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore +# /[Ll]ibrary/ /[Tt]emp/ /[Oo]bj/ /[Bb]uild/ /[Bb]uilds/ -/Assets/AssetStoreTools* +/[Ll]ogs/ +/[Uu]ser[Ss]ettings/ -# Visual Studio 2015 cache directory -/.vs/ +# MemoryCaptures can get excessive in size. +# They also could contain extremely sensitive data +/[Mm]emoryCaptures/ + +# Asset meta data should only be ignored when the corresponding asset is also ignored +!/[Aa]ssets/**/*.meta + +# Uncomment this line if you wish to ignore the asset store tools plugin +# /[Aa]ssets/AssetStoreTools* + +# Autogenerated Jetbrains Rider plugin +/[Aa]ssets/Plugins/Editor/JetBrains* + +# Visual Studio cache directory +.vs/ + +# Jetbrains Rider cache directory +.idea/ + +# Gradle cache directory +.gradle/ # Autogenerated VS/MD/Consulo solution and project files ExportedObj/ @@ -22,13 +46,29 @@ ExportedObj/ *.booproj *.svd *.pdb +*.mdb +*.opendb +*.VC.db # Unity3D generated meta files *.pidb.meta +*.pdb.meta +*.mdb.meta -# Unity3D Generated File On Crash Reports +# Unity3D generated file on crash reports sysinfo.txt # Builds *.apk +*.aab *.unitypackage + +# Crashlytics generated file +crashlytics-build.properties + +# Packed Addressables +/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* + +# Temporary auto-generated Android Assets +/[Aa]ssets/[Ss]treamingAssets/aa.meta +/[Aa]ssets/[Ss]treamingAssets/aa/* diff --git a/Assets/Readme.txt b/Assets/Readme.txt deleted file mode 100644 index 0682770..0000000 --- a/Assets/Readme.txt +++ /dev/null @@ -1,24 +0,0 @@ -Hi. - -This is a tutorial to learn how to implement singleton pattern in Unity. - -You just need to have a preload scene, the preload scene is included in Scenes folder and named _Preload for better naviation. -The _Preload scene must be at first in the Build Settings window. Go to File/Build Settings... and make sure the _Preload scene is at first. - -In the _Preload scene we have a game object named Singleton, this object is the main game object in the whole game that won't destroy on scene changes. -You can add more singleton scripts by attaching them to this singleton game object. - -Then you are can access the singleton scripts and objects in global. - -Also you can run game in any scene you like in development, because the singleton objects will be instantiated at runtime if they aren't available. -But make sure to run the production game from the _Preload scene to use the preconfigured settings and use the inspector. - -Hope you enjoy it. - -Resources: - - https://stackoverflow.com/questions/35890932/unity-game-manager-script-works-only-one-time/35891919#35891919 - https://github.com/UnityCommunity - https://github.com/BayatGames - -Thanks. \ No newline at end of file diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs deleted file mode 100644 index a95d6cc..0000000 --- a/Assets/Scripts/GameManager.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.SceneManagement; - -public class GameManager : Singleton -{ - - [SerializeField] - protected string m_PlayerName; - - protected virtual void Start () - { - SceneManager.LoadScene ( "Main Menu" ); - } - - public string GetPlayerName () - { - return m_PlayerName; - } - -} diff --git a/Assets/Scripts/Singleton.cs b/Assets/Scripts/Singleton.cs deleted file mode 100644 index 13bbc21..0000000 --- a/Assets/Scripts/Singleton.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public abstract class Singleton : MonoBehaviour where T : Component -{ - - #region Fields - - /// - /// The instance. - /// - private static T instance; - - #endregion - - #region Properties - - /// - /// Gets the instance. - /// - /// The instance. - public static T Instance - { - get - { - if ( instance == null ) - { - instance = FindObjectOfType (); - if ( instance == null ) - { - GameObject obj = new GameObject (); - obj.name = typeof ( T ).Name; - instance = obj.AddComponent (); - } - } - return instance; - } - } - - #endregion - - #region Methods - - /// - /// Use this for initialization. - /// - protected virtual void Awake () - { - if ( instance == null ) - { - instance = this as T; - DontDestroyOnLoad ( gameObject ); - } - else - { - Destroy ( gameObject ); - } - } - - #endregion - -} \ No newline at end of file diff --git a/Assets/Scripts/Singleton.cs.meta b/Assets/Scripts/Singleton.cs.meta deleted file mode 100644 index 6caa1e7..0000000 --- a/Assets/Scripts/Singleton.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ce49cf29f5faf754289d9c206d19cc66 -timeCreated: 1505546773 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Test.cs b/Assets/Scripts/Test.cs deleted file mode 100644 index 60bc281..0000000 --- a/Assets/Scripts/Test.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class Test : MonoBehaviour -{ - - void Start () - { - Debug.Log ( GameManager.Instance.GetPlayerName () ); - } - -} diff --git a/Assets/Scripts/Test.cs.meta b/Assets/Scripts/Test.cs.meta deleted file mode 100644 index 660178d..0000000 --- a/Assets/Scripts/Test.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3830e8558eabcdb46914e81e3114bf45 -timeCreated: 1505547424 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2383a9f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,74 @@ + +# Change Log + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +## [3.0.0] - 2025-02-20 + +Full conversion of project to UPM Package + +### Added + +- Change log +- Included support for Unity 6 with backward compatibility + +## Changed + +- Project structure for UPM package setup with instructions on installation + +## Fixed + +- Unused Imports + +## [2.0.1] - 2024-07-07 + +### Fixed + +- Instance caused a stack overflow + +## [2.0.0] - 2024-01-23 + +Major revision of the singletons implementation + +### Added + +- Added `PersistentMonoSingleton` which is persistent across scenes +- Added `ISingleton` interface for unifying the methods and calls +- Added assembly definition +- Added namespace (`UnityCommunity.UnitySingleton`) + +### Changed + +- Made `MonoSingleton` non-persistent + +## [1.2.1] - 2024-01-22 + +### Fixed + +- Added missing methods for `MonoSingleton` + +## [1.2.0] - 2017-12-2 + +### Added + +- Init for existing instance and basic editor mode support + +## [1.1.0] - 2023-11-27 + +### Added + +- Scene `Singleton` (or Local Singleton) for non-persistent singletons across scene changes +- `MonoSingleton` to quickly extend `MonoBehaviour` as singletons + +### Changed + +- Extended Generic `Singleton` class with additional virtual functions (earlier this was extending `MonoBehaviour`) + +## [1.0.0] - 2017-09-16 + +### Added + +- Base files for the project with a generic `Singleton` diff --git a/Assets/Readme.txt.meta b/CHANGELOG.md.meta similarity index 54% rename from Assets/Readme.txt.meta rename to CHANGELOG.md.meta index 551f09f..5bfa93f 100644 --- a/Assets/Readme.txt.meta +++ b/CHANGELOG.md.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: c300d2a197611da48ac6bc2d3101d20f -timeCreated: 1505547094 -licenseType: Free +guid: f0e376553447c434496b242ff15d23d8 TextScriptImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d5f29a9 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,39 @@ +# Contributing to Unity Singleton + +Thank you for considering contributing to Unity Singleton! We welcome contributions from the community to help improve this project. + +## How to Contribute + +1. **Fork the Repository**: Start by forking the repository to your GitHub account. + +2. **Clone the Repository**: Clone the forked repository to your local machine. + ```sh + git clone https://github.com/**your-username**/unitysingleton.git + ``` + +3. **Create a Branch**: Create a new branch for your feature or bugfix. + ```sh + git checkout -b **feature-name** + ``` + +4. **Make Changes**: Make your changes to the codebase. + +5. **Commit Changes**: Commit your changes with a clear and descriptive commit message. + ```sh + git commit -m "Description of the feature or fix" + ``` + +6. **Push Changes**: Push your changes to your forked repository. + ```sh + git push origin feature-name + ``` + +7. **Create a Pull Request**: Open a pull request to the main repository. Provide a clear description of your changes and any related issues. + +## Reporting Issues + +If you encounter any issues, please report them on the issues tab. Provide as much detail as possible to help us resolve the issue quickly. + +## Getting Help + +If you need help or have any questions, feel free to reach out by opening an issue or joining our community discussions. diff --git a/CONTRIBUTING.md.meta b/CONTRIBUTING.md.meta new file mode 100644 index 0000000..4568a67 --- /dev/null +++ b/CONTRIBUTING.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 24b5356e887ed9b4c97f35c6691bbec6 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LICENSE.meta b/LICENSE.meta new file mode 100644 index 0000000..b14077e --- /dev/null +++ b/LICENSE.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8548c2c59835a1947b46b3d1a5f08941 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/AudioManager.asset b/ProjectSettings/AudioManager.asset deleted file mode 100644 index da61125..0000000 --- a/ProjectSettings/AudioManager.asset +++ /dev/null @@ -1,17 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!11 &1 -AudioManager: - m_ObjectHideFlags: 0 - m_Volume: 1 - Rolloff Scale: 1 - Doppler Factor: 1 - Default Speaker Mode: 2 - m_SampleRate: 0 - m_DSPBufferSize: 0 - m_VirtualVoiceCount: 512 - m_RealVoiceCount: 32 - m_SpatializerPlugin: - m_AmbisonicDecoderPlugin: - m_DisableAudio: 0 - m_VirtualizeEffects: 1 diff --git a/ProjectSettings/ClusterInputManager.asset b/ProjectSettings/ClusterInputManager.asset deleted file mode 100644 index e7886b2..0000000 --- a/ProjectSettings/ClusterInputManager.asset +++ /dev/null @@ -1,6 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!236 &1 -ClusterInputManager: - m_ObjectHideFlags: 0 - m_Inputs: [] diff --git a/ProjectSettings/DynamicsManager.asset b/ProjectSettings/DynamicsManager.asset deleted file mode 100644 index 1931946..0000000 --- a/ProjectSettings/DynamicsManager.asset +++ /dev/null @@ -1,19 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!55 &1 -PhysicsManager: - m_ObjectHideFlags: 0 - serializedVersion: 3 - m_Gravity: {x: 0, y: -9.81, z: 0} - m_DefaultMaterial: {fileID: 0} - m_BounceThreshold: 2 - m_SleepThreshold: 0.005 - m_DefaultContactOffset: 0.01 - m_DefaultSolverIterations: 6 - m_DefaultSolverVelocityIterations: 1 - m_QueriesHitBackfaces: 0 - m_QueriesHitTriggers: 1 - m_EnableAdaptiveForce: 0 - m_EnablePCM: 1 - m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - m_AutoSimulation: 1 diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset deleted file mode 100644 index 391384b..0000000 --- a/ProjectSettings/EditorBuildSettings.asset +++ /dev/null @@ -1,16 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1045 &1 -EditorBuildSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Scenes: - - enabled: 1 - path: Assets/Scenes/_Preload.unity - guid: 5264bf0bd966f354a9b71d59147155c5 - - enabled: 1 - path: Assets/Scenes/Main Menu.unity - guid: fd897d8df8f2e6d43811bdc3fd3eb11e - - enabled: 1 - path: Assets/Scenes/Game.unity - guid: 499d8b731179029439d2ed711317b688 diff --git a/ProjectSettings/EditorSettings.asset b/ProjectSettings/EditorSettings.asset deleted file mode 100644 index f33b6fb..0000000 --- a/ProjectSettings/EditorSettings.asset +++ /dev/null @@ -1,16 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!159 &1 -EditorSettings: - m_ObjectHideFlags: 0 - serializedVersion: 4 - m_ExternalVersionControlSupport: Visible Meta Files - m_SerializationMode: 2 - m_DefaultBehaviorMode: 0 - m_SpritePackerMode: 0 - m_SpritePackerPaddingPower: 1 - m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd - m_ProjectGenerationRootNamespace: - m_UserGeneratedProjectSuffix: - m_CollabEditorSettings: - inProgressEnabled: 1 diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset deleted file mode 100644 index 74d7b53..0000000 --- a/ProjectSettings/GraphicsSettings.asset +++ /dev/null @@ -1,61 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!30 &1 -GraphicsSettings: - m_ObjectHideFlags: 0 - serializedVersion: 12 - m_Deferred: - m_Mode: 1 - m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} - m_DeferredReflections: - m_Mode: 1 - m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} - m_ScreenSpaceShadows: - m_Mode: 1 - m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} - m_LegacyDeferred: - m_Mode: 1 - m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} - m_DepthNormals: - m_Mode: 1 - m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} - m_MotionVectors: - m_Mode: 1 - m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} - m_LightHalo: - m_Mode: 1 - m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} - m_LensFlare: - m_Mode: 1 - m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} - m_AlwaysIncludedShaders: - - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - m_PreloadedShaders: [] - m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, - type: 0} - m_CustomRenderPipeline: {fileID: 0} - m_TransparencySortMode: 0 - m_TransparencySortAxis: {x: 0, y: 0, z: 1} - m_DefaultRenderingPath: 1 - m_DefaultMobileRenderingPath: 1 - m_TierSettings: [] - m_LightmapStripping: 0 - m_FogStripping: 0 - m_InstancingStripping: 0 - m_LightmapKeepPlain: 1 - m_LightmapKeepDirCombined: 1 - m_LightmapKeepDynamicPlain: 1 - m_LightmapKeepDynamicDirCombined: 1 - m_LightmapKeepShadowMask: 1 - m_LightmapKeepSubtractive: 1 - m_FogKeepLinear: 1 - m_FogKeepExp: 1 - m_FogKeepExp2: 1 - m_AlbedoSwatchInfos: [] - m_LightsUseLinearIntensity: 0 - m_LightsUseColorTemperature: 0 diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset deleted file mode 100644 index 17c8f53..0000000 --- a/ProjectSettings/InputManager.asset +++ /dev/null @@ -1,295 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!13 &1 -InputManager: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Axes: - - serializedVersion: 3 - m_Name: Horizontal - descriptiveName: - descriptiveNegativeName: - negativeButton: left - positiveButton: right - altNegativeButton: a - altPositiveButton: d - gravity: 3 - dead: 0.001 - sensitivity: 3 - snap: 1 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Vertical - descriptiveName: - descriptiveNegativeName: - negativeButton: down - positiveButton: up - altNegativeButton: s - altPositiveButton: w - gravity: 3 - dead: 0.001 - sensitivity: 3 - snap: 1 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire1 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left ctrl - altNegativeButton: - altPositiveButton: mouse 0 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire2 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left alt - altNegativeButton: - altPositiveButton: mouse 1 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire3 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left shift - altNegativeButton: - altPositiveButton: mouse 2 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Jump - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: space - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Mouse X - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0 - sensitivity: 0.1 - snap: 0 - invert: 0 - type: 1 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Mouse Y - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0 - sensitivity: 0.1 - snap: 0 - invert: 0 - type: 1 - axis: 1 - joyNum: 0 - - serializedVersion: 3 - m_Name: Mouse ScrollWheel - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0 - sensitivity: 0.1 - snap: 0 - invert: 0 - type: 1 - axis: 2 - joyNum: 0 - - serializedVersion: 3 - m_Name: Horizontal - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0.19 - sensitivity: 1 - snap: 0 - invert: 0 - type: 2 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Vertical - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0.19 - sensitivity: 1 - snap: 0 - invert: 1 - type: 2 - axis: 1 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire1 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 0 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire2 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 1 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire3 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 2 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Jump - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 3 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Submit - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: return - altNegativeButton: - altPositiveButton: joystick button 0 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Submit - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: enter - altNegativeButton: - altPositiveButton: space - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Cancel - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: escape - altNegativeButton: - altPositiveButton: joystick button 1 - gravity: 1000 - dead: 0.001 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 diff --git a/ProjectSettings/NavMeshAreas.asset b/ProjectSettings/NavMeshAreas.asset deleted file mode 100644 index 6dd520f..0000000 --- a/ProjectSettings/NavMeshAreas.asset +++ /dev/null @@ -1,89 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!126 &1 -NavMeshProjectSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - areas: - - name: Walkable - cost: 1 - - name: Not Walkable - cost: 1 - - name: Jump - cost: 2 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - m_LastAgentTypeID: -887442657 - m_Settings: - - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.75 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - m_SettingNames: - - Humanoid diff --git a/ProjectSettings/NetworkManager.asset b/ProjectSettings/NetworkManager.asset deleted file mode 100644 index 5dc6a83..0000000 --- a/ProjectSettings/NetworkManager.asset +++ /dev/null @@ -1,8 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!149 &1 -NetworkManager: - m_ObjectHideFlags: 0 - m_DebugLevel: 0 - m_Sendrate: 15 - m_AssetToPrefab: {} diff --git a/ProjectSettings/Physics2DSettings.asset b/ProjectSettings/Physics2DSettings.asset deleted file mode 100644 index e3b2d0b..0000000 --- a/ProjectSettings/Physics2DSettings.asset +++ /dev/null @@ -1,36 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!19 &1 -Physics2DSettings: - m_ObjectHideFlags: 0 - serializedVersion: 3 - m_Gravity: {x: 0, y: -9.81} - m_DefaultMaterial: {fileID: 0} - m_VelocityIterations: 8 - m_PositionIterations: 3 - m_VelocityThreshold: 1 - m_MaxLinearCorrection: 0.2 - m_MaxAngularCorrection: 8 - m_MaxTranslationSpeed: 100 - m_MaxRotationSpeed: 360 - m_BaumgarteScale: 0.2 - m_BaumgarteTimeOfImpactScale: 0.75 - m_TimeToSleep: 0.5 - m_LinearSleepTolerance: 0.01 - m_AngularSleepTolerance: 2 - m_DefaultContactOffset: 0.01 - m_AutoSimulation: 1 - m_QueriesHitTriggers: 1 - m_QueriesStartInColliders: 1 - m_ChangeStopsCallbacks: 0 - m_CallbacksOnDisable: 1 - m_AlwaysShowColliders: 0 - m_ShowColliderSleep: 1 - m_ShowColliderContacts: 0 - m_ShowColliderAABB: 0 - m_ContactArrowScale: 0.2 - m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} - m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} - m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} - m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} - m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset deleted file mode 100644 index 4bbfb81..0000000 --- a/ProjectSettings/ProjectSettings.asset +++ /dev/null @@ -1,597 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!129 &1 -PlayerSettings: - m_ObjectHideFlags: 0 - serializedVersion: 12 - productGUID: dc0d24de907948441b07cc35167c6a79 - AndroidProfiler: 0 - defaultScreenOrientation: 4 - targetDevice: 2 - useOnDemandResources: 0 - accelerometerFrequency: 60 - companyName: DefaultCompany - productName: UnitySingleton - defaultCursor: {fileID: 0} - cursorHotspot: {x: 0, y: 0} - m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} - m_ShowUnitySplashScreen: 1 - m_ShowUnitySplashLogo: 1 - m_SplashScreenOverlayOpacity: 1 - m_SplashScreenAnimation: 1 - m_SplashScreenLogoStyle: 1 - m_SplashScreenDrawMode: 0 - m_SplashScreenBackgroundAnimationZoom: 1 - m_SplashScreenLogoAnimationZoom: 1 - m_SplashScreenBackgroundLandscapeAspect: 1 - m_SplashScreenBackgroundPortraitAspect: 1 - m_SplashScreenBackgroundLandscapeUvs: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - m_SplashScreenBackgroundPortraitUvs: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - m_SplashScreenLogos: [] - m_SplashScreenBackgroundLandscape: {fileID: 0} - m_SplashScreenBackgroundPortrait: {fileID: 0} - m_VirtualRealitySplashScreen: {fileID: 0} - m_HolographicTrackingLossScreen: {fileID: 0} - defaultScreenWidth: 1024 - defaultScreenHeight: 768 - defaultScreenWidthWeb: 960 - defaultScreenHeightWeb: 600 - m_StereoRenderingPath: 0 - m_ActiveColorSpace: 0 - m_MTRendering: 1 - m_MobileMTRendering: 0 - m_StackTraceTypes: 010000000100000001000000010000000100000001000000 - iosShowActivityIndicatorOnLoading: -1 - androidShowActivityIndicatorOnLoading: -1 - tizenShowActivityIndicatorOnLoading: -1 - iosAppInBackgroundBehavior: 0 - displayResolutionDialog: 1 - iosAllowHTTPDownload: 1 - allowedAutorotateToPortrait: 1 - allowedAutorotateToPortraitUpsideDown: 1 - allowedAutorotateToLandscapeRight: 1 - allowedAutorotateToLandscapeLeft: 1 - useOSAutorotation: 1 - use32BitDisplayBuffer: 1 - disableDepthAndStencilBuffers: 0 - defaultIsFullScreen: 1 - defaultIsNativeResolution: 1 - runInBackground: 0 - captureSingleScreen: 0 - muteOtherAudioSources: 0 - Prepare IOS For Recording: 0 - Force IOS Speakers When Recording: 0 - submitAnalytics: 1 - usePlayerLog: 1 - bakeCollisionMeshes: 0 - forceSingleInstance: 0 - resizableWindow: 0 - useMacAppStoreValidation: 0 - macAppStoreCategory: public.app-category.games - gpuSkinning: 0 - graphicsJobs: 0 - xboxPIXTextureCapture: 0 - xboxEnableAvatar: 0 - xboxEnableKinect: 0 - xboxEnableKinectAutoTracking: 0 - xboxEnableFitness: 0 - visibleInBackground: 1 - allowFullscreenSwitch: 1 - graphicsJobMode: 0 - macFullscreenMode: 2 - d3d9FullscreenMode: 1 - d3d11FullscreenMode: 1 - xboxSpeechDB: 0 - xboxEnableHeadOrientation: 0 - xboxEnableGuest: 0 - xboxEnablePIXSampling: 0 - n3dsDisableStereoscopicView: 0 - n3dsEnableSharedListOpt: 1 - n3dsEnableVSync: 0 - ignoreAlphaClear: 0 - xboxOneResolution: 0 - xboxOneMonoLoggingLevel: 0 - xboxOneLoggingLevel: 1 - xboxOneDisableEsram: 0 - videoMemoryForVertexBuffers: 0 - psp2PowerMode: 0 - psp2AcquireBGM: 1 - wiiUTVResolution: 0 - wiiUGamePadMSAA: 1 - wiiUSupportsNunchuk: 0 - wiiUSupportsClassicController: 0 - wiiUSupportsBalanceBoard: 0 - wiiUSupportsMotionPlus: 0 - wiiUSupportsProController: 0 - wiiUAllowScreenCapture: 1 - wiiUControllerCount: 0 - m_SupportedAspectRatios: - 4:3: 1 - 5:4: 1 - 16:10: 1 - 16:9: 1 - Others: 1 - bundleVersion: 1.0 - preloadedAssets: [] - metroInputSource: 0 - m_HolographicPauseOnTrackingLoss: 1 - xboxOneDisableKinectGpuReservation: 0 - xboxOneEnable7thCore: 0 - vrSettings: - cardboard: - depthFormat: 0 - enableTransitionView: 0 - daydream: - depthFormat: 0 - useSustainedPerformanceMode: 0 - hololens: - depthFormat: 1 - protectGraphicsMemory: 0 - useHDRDisplay: 0 - targetPixelDensity: 0 - resolutionScalingMode: 0 - applicationIdentifier: {} - buildNumber: {} - AndroidBundleVersionCode: 1 - AndroidMinSdkVersion: 16 - AndroidTargetSdkVersion: 0 - AndroidPreferredInstallLocation: 1 - aotOptions: - stripEngineCode: 1 - iPhoneStrippingLevel: 0 - iPhoneScriptCallOptimization: 0 - ForceInternetPermission: 0 - ForceSDCardPermission: 0 - CreateWallpaper: 0 - APKExpansionFiles: 0 - keepLoadedShadersAlive: 0 - StripUnusedMeshComponents: 0 - VertexChannelCompressionMask: - serializedVersion: 2 - m_Bits: 238 - iPhoneSdkVersion: 988 - iOSTargetOSVersionString: - tvOSSdkVersion: 0 - tvOSRequireExtendedGameController: 0 - tvOSTargetOSVersionString: - uIPrerenderedIcon: 0 - uIRequiresPersistentWiFi: 0 - uIRequiresFullScreen: 1 - uIStatusBarHidden: 1 - uIExitOnSuspend: 0 - uIStatusBarStyle: 0 - iPhoneSplashScreen: {fileID: 0} - iPhoneHighResSplashScreen: {fileID: 0} - iPhoneTallHighResSplashScreen: {fileID: 0} - iPhone47inSplashScreen: {fileID: 0} - iPhone55inPortraitSplashScreen: {fileID: 0} - iPhone55inLandscapeSplashScreen: {fileID: 0} - iPadPortraitSplashScreen: {fileID: 0} - iPadHighResPortraitSplashScreen: {fileID: 0} - iPadLandscapeSplashScreen: {fileID: 0} - iPadHighResLandscapeSplashScreen: {fileID: 0} - appleTVSplashScreen: {fileID: 0} - tvOSSmallIconLayers: [] - tvOSLargeIconLayers: [] - tvOSTopShelfImageLayers: [] - tvOSTopShelfImageWideLayers: [] - iOSLaunchScreenType: 0 - iOSLaunchScreenPortrait: {fileID: 0} - iOSLaunchScreenLandscape: {fileID: 0} - iOSLaunchScreenBackgroundColor: - serializedVersion: 2 - rgba: 0 - iOSLaunchScreenFillPct: 100 - iOSLaunchScreenSize: 100 - iOSLaunchScreenCustomXibPath: - iOSLaunchScreeniPadType: 0 - iOSLaunchScreeniPadImage: {fileID: 0} - iOSLaunchScreeniPadBackgroundColor: - serializedVersion: 2 - rgba: 0 - iOSLaunchScreeniPadFillPct: 100 - iOSLaunchScreeniPadSize: 100 - iOSLaunchScreeniPadCustomXibPath: - iOSDeviceRequirements: [] - iOSURLSchemes: [] - iOSBackgroundModes: 0 - iOSMetalForceHardShadows: 0 - metalEditorSupport: 1 - metalAPIValidation: 1 - iOSRenderExtraFrameOnPause: 0 - appleDeveloperTeamID: - iOSManualSigningProvisioningProfileID: - tvOSManualSigningProvisioningProfileID: - appleEnableAutomaticSigning: 0 - AndroidTargetDevice: 0 - AndroidSplashScreenScale: 0 - androidSplashScreen: {fileID: 0} - AndroidKeystoreName: - AndroidKeyaliasName: - AndroidTVCompatibility: 1 - AndroidIsGame: 1 - androidEnableBanner: 1 - m_AndroidBanners: - - width: 320 - height: 180 - banner: {fileID: 0} - androidGamepadSupportLevel: 0 - resolutionDialogBanner: {fileID: 0} - m_BuildTargetIcons: [] - m_BuildTargetBatching: [] - m_BuildTargetGraphicsAPIs: [] - m_BuildTargetVRSettings: [] - openGLRequireES31: 0 - openGLRequireES31AEP: 0 - webPlayerTemplate: APPLICATION:Default - m_TemplateCustomTags: {} - wiiUTitleID: 0005000011000000 - wiiUGroupID: 00010000 - wiiUCommonSaveSize: 4096 - wiiUAccountSaveSize: 2048 - wiiUOlvAccessKey: 0 - wiiUTinCode: 0 - wiiUJoinGameId: 0 - wiiUJoinGameModeMask: 0000000000000000 - wiiUCommonBossSize: 0 - wiiUAccountBossSize: 0 - wiiUAddOnUniqueIDs: [] - wiiUMainThreadStackSize: 3072 - wiiULoaderThreadStackSize: 1024 - wiiUSystemHeapSize: 128 - wiiUTVStartupScreen: {fileID: 0} - wiiUGamePadStartupScreen: {fileID: 0} - wiiUDrcBufferDisabled: 0 - wiiUProfilerLibPath: - playModeTestRunnerEnabled: 0 - actionOnDotNetUnhandledException: 1 - enableInternalProfiler: 0 - logObjCUncaughtExceptions: 1 - enableCrashReportAPI: 0 - cameraUsageDescription: - locationUsageDescription: - microphoneUsageDescription: - switchNetLibKey: - switchSocketMemoryPoolSize: 6144 - switchSocketAllocatorPoolSize: 128 - switchSocketConcurrencyLimit: 14 - switchScreenResolutionBehavior: 2 - switchUseCPUProfiler: 0 - switchApplicationID: 0x01004b9000490000 - switchNSODependencies: - switchTitleNames_0: - switchTitleNames_1: - switchTitleNames_2: - switchTitleNames_3: - switchTitleNames_4: - switchTitleNames_5: - switchTitleNames_6: - switchTitleNames_7: - switchTitleNames_8: - switchTitleNames_9: - switchTitleNames_10: - switchTitleNames_11: - switchPublisherNames_0: - switchPublisherNames_1: - switchPublisherNames_2: - switchPublisherNames_3: - switchPublisherNames_4: - switchPublisherNames_5: - switchPublisherNames_6: - switchPublisherNames_7: - switchPublisherNames_8: - switchPublisherNames_9: - switchPublisherNames_10: - switchPublisherNames_11: - switchIcons_0: {fileID: 0} - switchIcons_1: {fileID: 0} - switchIcons_2: {fileID: 0} - switchIcons_3: {fileID: 0} - switchIcons_4: {fileID: 0} - switchIcons_5: {fileID: 0} - switchIcons_6: {fileID: 0} - switchIcons_7: {fileID: 0} - switchIcons_8: {fileID: 0} - switchIcons_9: {fileID: 0} - switchIcons_10: {fileID: 0} - switchIcons_11: {fileID: 0} - switchSmallIcons_0: {fileID: 0} - switchSmallIcons_1: {fileID: 0} - switchSmallIcons_2: {fileID: 0} - switchSmallIcons_3: {fileID: 0} - switchSmallIcons_4: {fileID: 0} - switchSmallIcons_5: {fileID: 0} - switchSmallIcons_6: {fileID: 0} - switchSmallIcons_7: {fileID: 0} - switchSmallIcons_8: {fileID: 0} - switchSmallIcons_9: {fileID: 0} - switchSmallIcons_10: {fileID: 0} - switchSmallIcons_11: {fileID: 0} - switchManualHTML: - switchAccessibleURLs: - switchLegalInformation: - switchMainThreadStackSize: 1048576 - switchPresenceGroupId: - switchLogoHandling: 0 - switchReleaseVersion: 0 - switchDisplayVersion: 1.0.0 - switchStartupUserAccount: 0 - switchTouchScreenUsage: 0 - switchSupportedLanguagesMask: 0 - switchLogoType: 0 - switchApplicationErrorCodeCategory: - switchUserAccountSaveDataSize: 0 - switchUserAccountSaveDataJournalSize: 0 - switchApplicationAttribute: 0 - switchCardSpecSize: -1 - switchCardSpecClock: -1 - switchRatingsMask: 0 - switchRatingsInt_0: 0 - switchRatingsInt_1: 0 - switchRatingsInt_2: 0 - switchRatingsInt_3: 0 - switchRatingsInt_4: 0 - switchRatingsInt_5: 0 - switchRatingsInt_6: 0 - switchRatingsInt_7: 0 - switchRatingsInt_8: 0 - switchRatingsInt_9: 0 - switchRatingsInt_10: 0 - switchRatingsInt_11: 0 - switchLocalCommunicationIds_0: - switchLocalCommunicationIds_1: - switchLocalCommunicationIds_2: - switchLocalCommunicationIds_3: - switchLocalCommunicationIds_4: - switchLocalCommunicationIds_5: - switchLocalCommunicationIds_6: - switchLocalCommunicationIds_7: - switchParentalControl: 0 - switchAllowsScreenshot: 1 - switchDataLossConfirmation: 0 - switchSupportedNpadStyles: 3 - switchSocketConfigEnabled: 0 - switchTcpInitialSendBufferSize: 32 - switchTcpInitialReceiveBufferSize: 64 - switchTcpAutoSendBufferSizeMax: 256 - switchTcpAutoReceiveBufferSizeMax: 256 - switchUdpSendBufferSize: 9 - switchUdpReceiveBufferSize: 42 - switchSocketBufferEfficiency: 4 - switchSocketInitializeEnabled: 1 - switchNetworkInterfaceManagerInitializeEnabled: 1 - switchPlayerConnectionEnabled: 1 - ps4NPAgeRating: 12 - ps4NPTitleSecret: - ps4NPTrophyPackPath: - ps4ParentalLevel: 11 - ps4ContentID: ED1633-NPXX51362_00-0000000000000000 - ps4Category: 0 - ps4MasterVersion: 01.00 - ps4AppVersion: 01.00 - ps4AppType: 0 - ps4ParamSfxPath: - ps4VideoOutPixelFormat: 0 - ps4VideoOutInitialWidth: 1920 - ps4VideoOutBaseModeInitialWidth: 1920 - ps4VideoOutReprojectionRate: 120 - ps4PronunciationXMLPath: - ps4PronunciationSIGPath: - ps4BackgroundImagePath: - ps4StartupImagePath: - ps4SaveDataImagePath: - ps4SdkOverride: - ps4BGMPath: - ps4ShareFilePath: - ps4ShareOverlayImagePath: - ps4PrivacyGuardImagePath: - ps4NPtitleDatPath: - ps4RemotePlayKeyAssignment: -1 - ps4RemotePlayKeyMappingDir: - ps4PlayTogetherPlayerCount: 0 - ps4EnterButtonAssignment: 1 - ps4ApplicationParam1: 0 - ps4ApplicationParam2: 0 - ps4ApplicationParam3: 0 - ps4ApplicationParam4: 0 - ps4DownloadDataSize: 0 - ps4GarlicHeapSize: 2048 - ps4ProGarlicHeapSize: 2560 - ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ - ps4pnSessions: 1 - ps4pnPresence: 1 - ps4pnFriends: 1 - ps4pnGameCustomData: 1 - playerPrefsSupport: 0 - restrictedAudioUsageRights: 0 - ps4UseResolutionFallback: 0 - ps4ReprojectionSupport: 0 - ps4UseAudio3dBackend: 0 - ps4SocialScreenEnabled: 0 - ps4ScriptOptimizationLevel: 0 - ps4Audio3dVirtualSpeakerCount: 14 - ps4attribCpuUsage: 0 - ps4PatchPkgPath: - ps4PatchLatestPkgPath: - ps4PatchChangeinfoPath: - ps4PatchDayOne: 0 - ps4attribUserManagement: 0 - ps4attribMoveSupport: 0 - ps4attrib3DSupport: 0 - ps4attribShareSupport: 0 - ps4attribExclusiveVR: 0 - ps4disableAutoHideSplash: 0 - ps4videoRecordingFeaturesUsed: 0 - ps4contentSearchFeaturesUsed: 0 - ps4attribEyeToEyeDistanceSettingVR: 0 - ps4IncludedModules: [] - monoEnv: - psp2Splashimage: {fileID: 0} - psp2NPTrophyPackPath: - psp2NPSupportGBMorGJP: 0 - psp2NPAgeRating: 12 - psp2NPTitleDatPath: - psp2NPCommsID: - psp2NPCommunicationsID: - psp2NPCommsPassphrase: - psp2NPCommsSig: - psp2ParamSfxPath: - psp2ManualPath: - psp2LiveAreaGatePath: - psp2LiveAreaBackroundPath: - psp2LiveAreaPath: - psp2LiveAreaTrialPath: - psp2PatchChangeInfoPath: - psp2PatchOriginalPackage: - psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui - psp2KeystoneFile: - psp2MemoryExpansionMode: 0 - psp2DRMType: 0 - psp2StorageType: 0 - psp2MediaCapacity: 0 - psp2DLCConfigPath: - psp2ThumbnailPath: - psp2BackgroundPath: - psp2SoundPath: - psp2TrophyCommId: - psp2TrophyPackagePath: - psp2PackagedResourcesPath: - psp2SaveDataQuota: 10240 - psp2ParentalLevel: 1 - psp2ShortTitle: Not Set - psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF - psp2Category: 0 - psp2MasterVersion: 01.00 - psp2AppVersion: 01.00 - psp2TVBootMode: 0 - psp2EnterButtonAssignment: 2 - psp2TVDisableEmu: 0 - psp2AllowTwitterDialog: 1 - psp2Upgradable: 0 - psp2HealthWarning: 0 - psp2UseLibLocation: 0 - psp2InfoBarOnStartup: 0 - psp2InfoBarColor: 0 - psp2ScriptOptimizationLevel: 0 - psmSplashimage: {fileID: 0} - splashScreenBackgroundSourceLandscape: {fileID: 0} - splashScreenBackgroundSourcePortrait: {fileID: 0} - spritePackerPolicy: - webGLMemorySize: 256 - webGLExceptionSupport: 1 - webGLNameFilesAsHashes: 0 - webGLDataCaching: 0 - webGLDebugSymbols: 0 - webGLEmscriptenArgs: - webGLModulesDirectory: - webGLTemplate: APPLICATION:Default - webGLAnalyzeBuildSize: 0 - webGLUseEmbeddedResources: 0 - webGLUseWasm: 0 - webGLCompressionFormat: 1 - scriptingDefineSymbols: {} - platformArchitecture: {} - scriptingBackend: {} - incrementalIl2cppBuild: {} - additionalIl2CppArgs: - scriptingRuntimeVersion: 0 - apiCompatibilityLevelPerPlatform: {} - m_RenderingPath: 1 - m_MobileRenderingPath: 1 - metroPackageName: UnitySingleton - metroPackageVersion: - metroCertificatePath: - metroCertificatePassword: - metroCertificateSubject: - metroCertificateIssuer: - metroCertificateNotAfter: 0000000000000000 - metroApplicationDescription: UnitySingleton - wsaImages: {} - metroTileShortName: - metroCommandLineArgsFile: - metroTileShowName: 0 - metroMediumTileShowName: 0 - metroLargeTileShowName: 0 - metroWideTileShowName: 0 - metroDefaultTileSize: 1 - metroTileForegroundText: 2 - metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} - metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, - a: 1} - metroSplashScreenUseBackgroundColor: 0 - platformCapabilities: {} - metroFTAName: - metroFTAFileTypes: [] - metroProtocolName: - metroCompilationOverrides: 1 - tizenProductDescription: - tizenProductURL: - tizenSigningProfileName: - tizenGPSPermissions: 0 - tizenMicrophonePermissions: 0 - tizenDeploymentTarget: - tizenDeploymentTargetType: -1 - tizenMinOSVersion: 1 - n3dsUseExtSaveData: 0 - n3dsCompressStaticMem: 1 - n3dsExtSaveDataNumber: 0x12345 - n3dsStackSize: 131072 - n3dsTargetPlatform: 2 - n3dsRegion: 7 - n3dsMediaSize: 0 - n3dsLogoStyle: 3 - n3dsTitle: GameName - n3dsProductCode: - n3dsApplicationId: 0xFF3FF - stvDeviceAddress: - stvProductDescription: - stvProductAuthor: - stvProductAuthorEmail: - stvProductLink: - stvProductCategory: 0 - XboxOneProductId: - XboxOneUpdateKey: - XboxOneSandboxId: - XboxOneContentId: - XboxOneTitleId: - XboxOneSCId: - XboxOneGameOsOverridePath: - XboxOnePackagingOverridePath: - XboxOneAppManifestOverridePath: - XboxOnePackageEncryption: 0 - XboxOnePackageUpdateGranularity: 2 - XboxOneDescription: - XboxOneLanguage: - - enus - XboxOneCapability: [] - XboxOneGameRating: {} - XboxOneIsContentPackage: 0 - XboxOneEnableGPUVariability: 0 - XboxOneSockets: {} - XboxOneSplashScreen: {fileID: 0} - XboxOneAllowedProductIds: [] - XboxOnePersistentLocalStorageSize: 0 - xboxOneScriptCompiler: 0 - vrEditorSettings: - daydream: - daydreamIconForeground: {fileID: 0} - daydreamIconBackground: {fileID: 0} - cloudServicesEnabled: {} - facebookSdkVersion: 7.9.4 - apiCompatibilityLevel: 2 - cloudProjectId: - projectName: - organizationId: - cloudEnabled: 0 - enableNativePlatformBackendsForNewInputSystem: 0 - disableOldInputManagerSupport: 0 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt deleted file mode 100644 index c0a7b29..0000000 --- a/ProjectSettings/ProjectVersion.txt +++ /dev/null @@ -1 +0,0 @@ -m_EditorVersion: 2017.1.0p4 diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset deleted file mode 100644 index 86c047f..0000000 --- a/ProjectSettings/QualitySettings.asset +++ /dev/null @@ -1,193 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!47 &1 -QualitySettings: - m_ObjectHideFlags: 0 - serializedVersion: 5 - m_CurrentQuality: 5 - m_QualitySettings: - - serializedVersion: 2 - name: Very Low - pixelLightCount: 0 - shadows: 0 - shadowResolution: 0 - shadowProjection: 1 - shadowCascades: 1 - shadowDistance: 15 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 0 - blendWeights: 1 - textureQuality: 1 - anisotropicTextures: 0 - antiAliasing: 0 - softParticles: 0 - softVegetation: 0 - realtimeReflectionProbes: 0 - billboardsFaceCameraPosition: 0 - vSyncCount: 0 - lodBias: 0.3 - maximumLODLevel: 0 - particleRaycastBudget: 4 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 4 - resolutionScalingFixedDPIFactor: 1 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Low - pixelLightCount: 0 - shadows: 0 - shadowResolution: 0 - shadowProjection: 1 - shadowCascades: 1 - shadowDistance: 20 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 0 - blendWeights: 2 - textureQuality: 0 - anisotropicTextures: 0 - antiAliasing: 0 - softParticles: 0 - softVegetation: 0 - realtimeReflectionProbes: 0 - billboardsFaceCameraPosition: 0 - vSyncCount: 0 - lodBias: 0.4 - maximumLODLevel: 0 - particleRaycastBudget: 16 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 4 - resolutionScalingFixedDPIFactor: 1 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Medium - pixelLightCount: 1 - shadows: 1 - shadowResolution: 0 - shadowProjection: 1 - shadowCascades: 1 - shadowDistance: 20 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 0 - blendWeights: 2 - textureQuality: 0 - anisotropicTextures: 1 - antiAliasing: 0 - softParticles: 0 - softVegetation: 0 - realtimeReflectionProbes: 0 - billboardsFaceCameraPosition: 0 - vSyncCount: 1 - lodBias: 0.7 - maximumLODLevel: 0 - particleRaycastBudget: 64 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 4 - resolutionScalingFixedDPIFactor: 1 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: High - pixelLightCount: 2 - shadows: 2 - shadowResolution: 1 - shadowProjection: 1 - shadowCascades: 2 - shadowDistance: 40 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 1 - blendWeights: 2 - textureQuality: 0 - anisotropicTextures: 1 - antiAliasing: 0 - softParticles: 0 - softVegetation: 1 - realtimeReflectionProbes: 1 - billboardsFaceCameraPosition: 1 - vSyncCount: 1 - lodBias: 1 - maximumLODLevel: 0 - particleRaycastBudget: 256 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 4 - resolutionScalingFixedDPIFactor: 1 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Very High - pixelLightCount: 3 - shadows: 2 - shadowResolution: 2 - shadowProjection: 1 - shadowCascades: 2 - shadowDistance: 70 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 1 - blendWeights: 4 - textureQuality: 0 - anisotropicTextures: 2 - antiAliasing: 2 - softParticles: 1 - softVegetation: 1 - realtimeReflectionProbes: 1 - billboardsFaceCameraPosition: 1 - vSyncCount: 1 - lodBias: 1.5 - maximumLODLevel: 0 - particleRaycastBudget: 1024 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 4 - resolutionScalingFixedDPIFactor: 1 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Ultra - pixelLightCount: 4 - shadows: 2 - shadowResolution: 2 - shadowProjection: 1 - shadowCascades: 4 - shadowDistance: 150 - shadowNearPlaneOffset: 3 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 1 - blendWeights: 4 - textureQuality: 0 - anisotropicTextures: 2 - antiAliasing: 2 - softParticles: 1 - softVegetation: 1 - realtimeReflectionProbes: 1 - billboardsFaceCameraPosition: 1 - vSyncCount: 1 - lodBias: 2 - maximumLODLevel: 0 - particleRaycastBudget: 4096 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 4 - resolutionScalingFixedDPIFactor: 1 - excludedTargetPlatforms: [] - m_PerPlatformDefaultQuality: - Android: 2 - Nintendo 3DS: 5 - Nintendo Switch: 5 - PS4: 5 - PSM: 5 - PSP2: 2 - Samsung TV: 2 - Standalone: 5 - Tizen: 2 - Web: 5 - WebGL: 3 - WiiU: 5 - Windows Store Apps: 5 - XboxOne: 5 - iPhone: 2 - tvOS: 2 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset deleted file mode 100644 index 1c92a78..0000000 --- a/ProjectSettings/TagManager.asset +++ /dev/null @@ -1,43 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!78 &1 -TagManager: - serializedVersion: 2 - tags: [] - layers: - - Default - - TransparentFX - - Ignore Raycast - - - - Water - - UI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - m_SortingLayers: - - name: Default - uniqueID: 0 - locked: 0 diff --git a/ProjectSettings/TimeManager.asset b/ProjectSettings/TimeManager.asset deleted file mode 100644 index 558a017..0000000 --- a/ProjectSettings/TimeManager.asset +++ /dev/null @@ -1,9 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!5 &1 -TimeManager: - m_ObjectHideFlags: 0 - Fixed Timestep: 0.02 - Maximum Allowed Timestep: 0.33333334 - m_TimeScale: 1 - Maximum Particle Timestep: 0.03 diff --git a/ProjectSettings/UnityConnectSettings.asset b/ProjectSettings/UnityConnectSettings.asset deleted file mode 100644 index 1cc5485..0000000 --- a/ProjectSettings/UnityConnectSettings.asset +++ /dev/null @@ -1,34 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!310 &1 -UnityConnectSettings: - m_ObjectHideFlags: 0 - m_Enabled: 0 - m_TestMode: 0 - m_TestEventUrl: - m_TestConfigUrl: - m_TestInitMode: 0 - CrashReportingSettings: - m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes - m_Enabled: 0 - m_CaptureEditorExceptions: 1 - UnityPurchasingSettings: - m_Enabled: 0 - m_TestMode: 0 - UnityAnalyticsSettings: - m_Enabled: 0 - m_InitializeOnStartup: 1 - m_TestMode: 0 - m_TestEventUrl: - m_TestConfigUrl: - UnityAdsSettings: - m_Enabled: 0 - m_InitializeOnStartup: 1 - m_TestMode: 0 - m_EnabledPlatforms: 4294967295 - m_IosGameId: - m_AndroidGameId: - m_GameIds: {} - m_GameId: - PerformanceReportingSettings: - m_Enabled: 0 diff --git a/README.md b/README.md index 5d02d21..8c4d6bc 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ | [Getting Started](#getting-started) | [Features](#features) | [License](#license) | [Resources](#resources) | [Download](#download) | -|-------------------------------------|-----------------------|---------------------|-------------------------|-----------------------| +| ----------------------------------- | --------------------- | ------------------- | ----------------------- | --------------------- | # Unity Singleton -The best way to implement singleton pattern in Unity. By using this pattern you will be able to define Global variables and classes and use their methods and properties in Global. This pattern is a must have for most of the games that made using Unity engine. +The best way to implement singleton pattern in Unity. By using this pattern you will be able to define Global variables and classes and use their methods and properties in Global. This pattern is a must-have for most of the games that made using Unity engine. -:book: [Learn More about Singleton pattern](https://en.wikipedia.org/wiki/Singleton_pattern) +📖 [Learn More about Singleton pattern](https://en.wikipedia.org/wiki/Singleton_pattern) ## Features @@ -15,13 +15,34 @@ The best way to implement singleton pattern in Unity. By using this pattern you ## Getting Started -- [Download the Project](#download). -- Open the Project in Unity. -- Create your own Singleton classes by extending the Generic [:sparkles: Singleton :sparkles:](https://github.com/UnityCommunity/UnitySingleton/blob/master/Assets/Scripts/Singleton.cs) class. [:rocket: Check out the example GameManager](https://github.com/UnityCommunity/UnitySingleton/blob/master/Assets/Scripts/GameManager.cs) -- Attach your singleton classes to the GameManager game object in the _Preload scene. +This package can be added to your project via [Git UPM](https://docs.unity3d.com/6000.0/Documentation/Manual/upm-ui-giturl.html). +To add this package, copy: + +```shell +https://github.com/UnityCommunity/UnitySingleton.git +``` + +and add it as a git package in the Unity Package Manager by clicking on the "+" icon on the top left of the Package Manager Window, and selecting "Install package from git URL". + +Once you have the package installed, you may + +- Create your own Singleton classes by extending the Generic [✨ Singleton ✨](Runtime/Scripts/Singleton.cs) class. (🚀 Check out the example [GameManager](Samples~/Scripts/GameManager.cs) in the example [\_Preload scene](Samples~/Scenes/_Preload.unity).) +- Attach your singleton classes to a GameManager game object in a \_Preload scene of your own. - Edit the variables inside the inspector - Run the game and enjoy! +## Usage + +Add `using UnityCommunity.UnitySingleton;` for using the classes. + +- Use `Singleton` for plain C# classes. +- Use `MonoSingleton` if you want a Scene-based singleton which is not persistent across scenes. +- Use `PersistentMonoSingleton` if you want a Global and persistent singleton across scenes. + +## Contribute + +Please refer to [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to contribute to this project. + ## Download Run the following command in terminal or command prompt to clone the repository: @@ -30,18 +51,16 @@ Run the following command in terminal or command prompt to clone the repository: git clone https://github.com/UnityCommunity/UnitySingleton.git ``` -Or [:fire: Download the master branch as zip](https://github.com/UnityCommunity/UnitySingleton/archive/master.zip). +Or [🔥 Download the master branch as zip](https://github.com/UnityCommunity/UnitySingleton/archive/master.zip). ## Resources -- [:book: UnityGeek Singleton Article](http://www.unitygeek.com/unity_c_singleton/) -- [:book: Stackoverflow Answer](https://stackoverflow.com/questions/35890932/unity-game-manager-script-works-only-one-time/35891919#35891919) -- [:book: Unity Offical Wiki Singleton](http://wiki.unity3d.com/index.php/Singleton) -- [:book: Singleton.cs Gist](https://gist.github.com/EmpireWorld/11ff050fc1affc733ea74a497ce42961) -- [:book: Wikipedia](https://en.wikipedia.org/wiki/Singleton_pattern) +- [📖 Wikipedia](https://en.wikipedia.org/wiki/Singleton_pattern) +- [📖 On the \_Preload Scene](https://stackoverflow.com/questions/35890932/unity-game-manager-script-works-only-one-time/35891919#35891919) +- [▶️ Deep dive into the Singleton Pattern](https://www.youtube.com/watch?v=mpM0C6quQjs) ## License MIT @ [Unity Community](https://github.com/UnityCommunity) -Made with :heart: by [Unity Community](https://github.com/UnityCommunity) +Made with ❤️ by [Unity Community](https://github.com/UnityCommunity) diff --git a/README.md.meta b/README.md.meta new file mode 100644 index 0000000..856cce1 --- /dev/null +++ b/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8a91ec861a8abb547b8934ca3a3fd16d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes.meta b/Runtime.meta similarity index 57% rename from Assets/Scenes.meta rename to Runtime.meta index 77787b9..773465a 100644 --- a/Assets/Scenes.meta +++ b/Runtime.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: f7976d5cdeac54d44a4a18cefb75b672 +guid: ce805a05ddc963747a4dc94cb43e45af folderAsset: yes -timeCreated: 1505546764 -licenseType: Free DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Scripts.meta b/Runtime/Scripts.meta similarity index 57% rename from Assets/Scripts.meta rename to Runtime/Scripts.meta index 308b4a6..0bc5176 100644 --- a/Assets/Scripts.meta +++ b/Runtime/Scripts.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: aaa3a38b294872e429be3a5a74721fa3 +guid: 6bbedb2a0fe1045428904f242ef23df1 folderAsset: yes -timeCreated: 1505546752 -licenseType: Free DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Runtime/Scripts/ISingleton.cs b/Runtime/Scripts/ISingleton.cs new file mode 100644 index 0000000..b737a93 --- /dev/null +++ b/Runtime/Scripts/ISingleton.cs @@ -0,0 +1,12 @@ +namespace UnityCommunity.UnitySingleton +{ + /// + /// The singleton interface. + /// + public interface ISingleton + { + public void InitializeSingleton(); + + public void ClearSingleton(); + } +} \ No newline at end of file diff --git a/Runtime/Scripts/ISingleton.cs.meta b/Runtime/Scripts/ISingleton.cs.meta new file mode 100644 index 0000000..f142379 --- /dev/null +++ b/Runtime/Scripts/ISingleton.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c74da12ece85ed04ab1bd15679da7a4e \ No newline at end of file diff --git a/Runtime/Scripts/MonoSingleton.cs b/Runtime/Scripts/MonoSingleton.cs new file mode 100644 index 0000000..d4bdd7b --- /dev/null +++ b/Runtime/Scripts/MonoSingleton.cs @@ -0,0 +1,151 @@ +using UnityEngine; + +namespace UnityCommunity.UnitySingleton +{ + /// + /// The basic MonoBehaviour singleton implementation, this singleton is destroyed after scene changes, use if you want a persistent and global singleton instance. + /// + /// + [DefaultExecutionOrder(-50)] + public abstract class MonoSingleton : MonoBehaviour, ISingleton where T : MonoSingleton + { + #region Fields + + /// + /// The instance. + /// + private static T instance; + + /// + /// The initialization status of the singleton's instance. + /// + private SingletonInitializationStatus initializationStatus = SingletonInitializationStatus.None; + + #endregion + + #region Properties + + /// + /// Gets the instance. + /// + /// The instance. + public static T Instance + { + get + { + if (instance == null) + { +#if UNITY_6000 + instance = FindAnyObjectByType(); +#else + instance = FindObjectOfType(); +#endif + if (instance == null) + { + GameObject obj = new GameObject(); + obj.name = typeof(T).Name; + instance = obj.AddComponent(); + instance.OnMonoSingletonCreated(); + } + } + return instance; + } + } + + /// + /// Gets whether the singleton's instance is initialized. + /// + public virtual bool IsInitialized => this.initializationStatus == SingletonInitializationStatus.Initialized; + + #endregion + + #region Unity Messages + + /// + /// Use this for initialization. + /// + protected virtual void Awake() + { + if (instance == null) + { + instance = this as T; + + // Initialize existing instance + InitializeSingleton(); + } + else if (instance != this) + { + + // Destory duplicates + if (Application.isPlaying) + { + Destroy(gameObject); + } + else + { + DestroyImmediate(gameObject); + } + } + } + + #endregion + + #region Protected Methods + + /// + /// This gets called once the singleton's instance is created. + /// + protected virtual void OnMonoSingletonCreated() + { + + } + + protected virtual void OnInitializing() + { + + } + + protected virtual void OnInitialized() + { + + } + + #endregion + + #region Public Methods + + public virtual void InitializeSingleton() + { + if (this.initializationStatus != SingletonInitializationStatus.None) + { + return; + } + + this.initializationStatus = SingletonInitializationStatus.Initializing; + OnInitializing(); + this.initializationStatus = SingletonInitializationStatus.Initialized; + OnInitialized(); + } + + public virtual void ClearSingleton() { } + + public static void CreateInstance() + { + DestroyInstance(); + instance = Instance; + } + + public static void DestroyInstance() + { + if (instance == null) + { + return; + } + + instance.ClearSingleton(); + instance = default(T); + } + + #endregion + } +} diff --git a/Runtime/Scripts/MonoSingleton.cs.meta b/Runtime/Scripts/MonoSingleton.cs.meta new file mode 100644 index 0000000..fc5b001 --- /dev/null +++ b/Runtime/Scripts/MonoSingleton.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d1dd8bf5a34f8d44e82ce68fc0929036 \ No newline at end of file diff --git a/Runtime/Scripts/PersistentMonoSingleton.cs b/Runtime/Scripts/PersistentMonoSingleton.cs new file mode 100644 index 0000000..8a19221 --- /dev/null +++ b/Runtime/Scripts/PersistentMonoSingleton.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +namespace UnityCommunity.UnitySingleton +{ + /// + /// This singleton is persistent across scenes by calling . + /// + /// + public abstract class PersistentMonoSingleton : MonoSingleton where T : MonoSingleton + { + /// + /// if this is true, this singleton will auto detach if it finds itself parented on awake + /// + [Tooltip("if this is true, this singleton will auto detach if it finds itself parented on awake")] + [SerializeField] private bool UnparentOnAwake = true; + + #region Protected Methods + + protected override void OnInitializing() + { + if (UnparentOnAwake) { + transform.SetParent(null); + } + base.OnInitializing(); + if (Application.isPlaying) + { + DontDestroyOnLoad(gameObject); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Runtime/Scripts/PersistentMonoSingleton.cs.meta b/Runtime/Scripts/PersistentMonoSingleton.cs.meta new file mode 100644 index 0000000..2800fb1 --- /dev/null +++ b/Runtime/Scripts/PersistentMonoSingleton.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c5a25f5168adee44b8aa5522c314a274 \ No newline at end of file diff --git a/Runtime/Scripts/Singleton.cs b/Runtime/Scripts/Singleton.cs new file mode 100644 index 0000000..4766c1e --- /dev/null +++ b/Runtime/Scripts/Singleton.cs @@ -0,0 +1,117 @@ +namespace UnityCommunity.UnitySingleton +{ + public enum SingletonInitializationStatus + { + None, + Initializing, + Initialized + } + + /// + /// The singleton implementation for classes. + /// + /// + public abstract class Singleton : ISingleton where T : Singleton, new() + { + + #region Fields + + /// + /// The instance. + /// + private static T instance; + + /// + /// The initialization status of the singleton's instance. + /// + private SingletonInitializationStatus initializationStatus = SingletonInitializationStatus.None; + + #endregion + + #region Properties + + /// + /// Gets the instance. + /// + /// The instance. + public static T Instance + { + get + { + if (instance == null) + { + //ensure that only one thread can execute + lock (typeof(T)) + { + if (instance == null) + { + instance = new T(); + instance.InitializeSingleton(); + } + } + } + + return instance; + } + } + + /// + /// Gets whether the singleton's instance is initialized. + /// + public virtual bool IsInitialized => this.initializationStatus == SingletonInitializationStatus.Initialized; + + #endregion + + #region Protected Methods + + protected virtual void OnInitializing() + { + + } + + protected virtual void OnInitialized() + { + + } + + #endregion + + #region Public Methods + + public virtual void InitializeSingleton() + { + if (this.initializationStatus != SingletonInitializationStatus.None) + { + return; + } + + this.initializationStatus = SingletonInitializationStatus.Initializing; + OnInitializing(); + this.initializationStatus = SingletonInitializationStatus.Initialized; + OnInitialized(); + } + + public virtual void ClearSingleton() { } + + public static void CreateInstance() + { + DestroyInstance(); + instance = Instance; + } + + public static void DestroyInstance() + { + if (instance == null) + { + return; + } + + instance.ClearSingleton(); + instance = default(T); + } + + #endregion + + } + +} \ No newline at end of file diff --git a/Runtime/Scripts/Singleton.cs.meta b/Runtime/Scripts/Singleton.cs.meta new file mode 100644 index 0000000..c25bf2f --- /dev/null +++ b/Runtime/Scripts/Singleton.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 84eb48fd76368e04598346d2598c5d6f \ No newline at end of file diff --git a/Runtime/UnityCommunity.UnitySingleton.asmdef b/Runtime/UnityCommunity.UnitySingleton.asmdef new file mode 100644 index 0000000..6ba9b84 --- /dev/null +++ b/Runtime/UnityCommunity.UnitySingleton.asmdef @@ -0,0 +1,14 @@ +{ + "name": "UnityCommunity.UnitySingleton", + "rootNamespace": "UnityCommunity.UnitySingleton", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": true, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Runtime/UnityCommunity.UnitySingleton.asmdef.meta b/Runtime/UnityCommunity.UnitySingleton.asmdef.meta new file mode 100644 index 0000000..269419a --- /dev/null +++ b/Runtime/UnityCommunity.UnitySingleton.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: de184cc3ec226704b92a2445e8648cf3 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/Readme.asset b/Samples~/Readme.asset new file mode 100644 index 0000000..b34adb1 --- /dev/null +++ b/Samples~/Readme.asset @@ -0,0 +1,33 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fcf7219bab7fe46a1ad266029b2fee19, type: 3} + m_Name: Readme + m_EditorClassIdentifier: + title: How to use Unity Singleton + sections: + - heading: Example Usage + text: + - This is a quick demo on how to use the Unity Singleton Package + - 'To quickly test it out:' + - "\u2022 Go to the Scenes in this Samples folder" + - "\u2022 Add the scenes in the following order" + - " \u2022 _Preload" + - " \u2022 Main Menu" + - "\u2022 Then open the Scenes folder and edit the name parameter on the GameManager component attached to the GameManager object" + - "\u2022 Save and press play" + - "\u2022 The scene will change to the Main Menu, and the log will print out the name provided" + - heading: Functionality overview + text: + - Add using UnityCommunity.UnitySingleton; for using the classes + - "\u2022 Use Singleton for plain C# classes" + - "\u2022 Use MonoSingleton if you want a Scene-based singleton which is not persistent across scenes" + - "\u2022 Use PersistentMonoSingleton if you want a Global and persistent singleton across scenes" diff --git a/Samples~/SamplesGuideInfo/Scripts.meta b/Samples~/SamplesGuideInfo/Scripts.meta new file mode 100644 index 0000000..a143579 --- /dev/null +++ b/Samples~/SamplesGuideInfo/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ff02088bc4508c64895365f91fac63de +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/SamplesGuideInfo/Scripts/Editor.meta b/Samples~/SamplesGuideInfo/Scripts/Editor.meta new file mode 100644 index 0000000..f59f099 --- /dev/null +++ b/Samples~/SamplesGuideInfo/Scripts/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3ad9b87dffba344c89909c6d1b1c17e1 +folderAsset: yes +timeCreated: 1475593892 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/SamplesGuideInfo/Scripts/Editor/ReadmeEditor.cs b/Samples~/SamplesGuideInfo/Scripts/Editor/ReadmeEditor.cs new file mode 100644 index 0000000..b86b095 --- /dev/null +++ b/Samples~/SamplesGuideInfo/Scripts/Editor/ReadmeEditor.cs @@ -0,0 +1,178 @@ +// Copyright (c) Unity Technologies. +// Based on the "URP TutorialInfo ReadmeEditor.cs" script included in URP template projects. +// +// Original asset by Unity Technologies. This version has been modified to display +// a custom Readme.asset in the Inspector about how to use the Singletons package +// +// Modified by github.com/ThatAmuzak - 2025 + +using UnityEngine; +using UnityEditor; +using System.IO; + +[CustomEditor(typeof(Readme))] +public class ReadmeEditor : Editor +{ + const float k_Space = 8f; + + static void RemoveTutorial() + { + string s_ReadmeSourcePath = GetReadmePath(); + if (string.IsNullOrEmpty(s_ReadmeSourcePath)) + { + Debug.LogWarning("Could not determine the Readme folder path."); + return; + } + + string s_ReadmeSourceDirectory = Path.GetDirectoryName(s_ReadmeSourcePath) + "\\SamplesGuideInfo"; + + if (EditorUtility.DisplayDialog("Remove Readme Assets", $"All contents under {s_ReadmeSourceDirectory} will be removed, are you sure you want to proceed?", "Proceed", "Cancel")) + { + if (Directory.Exists(s_ReadmeSourceDirectory)) + { + FileUtil.DeleteFileOrDirectory(s_ReadmeSourceDirectory); + FileUtil.DeleteFileOrDirectory(s_ReadmeSourceDirectory + ".meta"); + } + else + { + Debug.Log($"Could not find the Readme folder at {s_ReadmeSourceDirectory}"); + } + + var readmeAsset = SelectReadme(); + if (readmeAsset != null) + { + var path = AssetDatabase.GetAssetPath(readmeAsset); + FileUtil.DeleteFileOrDirectory(path + ".meta"); + FileUtil.DeleteFileOrDirectory(path); + } + + AssetDatabase.Refresh(); + } + } + + static string GetReadmePath() + { + var readmeAsset = Selection.activeObject; + if (readmeAsset == null) return string.Empty; + + string path = AssetDatabase.GetAssetPath(readmeAsset); + return path; + } + + static Readme SelectReadme() + { + var ids = AssetDatabase.FindAssets("Readme t:Readme"); + if (ids.Length == 1) + { + var readmeObject = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids[0])); + + Selection.objects = new[] { readmeObject }; + + return (Readme)readmeObject; + } + + Debug.Log("Couldn't find a readme"); + return null; + } + + protected override void OnHeaderGUI() + { + var readme = (Readme)target; + Init(); + + GUILayout.BeginHorizontal("In BigTitle"); + { + GUILayout.Space(k_Space); + GUILayout.BeginVertical(); + { + + GUILayout.FlexibleSpace(); + GUILayout.Label(readme.title, TitleStyle); + GUILayout.FlexibleSpace(); + } + GUILayout.EndVertical(); + GUILayout.FlexibleSpace(); + } + GUILayout.EndHorizontal(); + } + + public override void OnInspectorGUI() + { + var readme = (Readme)target; + Init(); + Rect rect; + foreach (var section in readme.sections) + { + GUILayout.Space(k_Space); + rect = EditorGUILayout.GetControlRect(false, 2 ); + rect.height = 2; + EditorGUI.DrawRect(rect, new Color ( 0.5f,0.5f,0.5f, 1 ) ); + GUILayout.Space(k_Space); + + if (!string.IsNullOrEmpty(section.heading)) + { + GUILayout.Label(section.heading, HeadingStyle); + } + + foreach (var subtext in section.text) + { + if (!string.IsNullOrEmpty(subtext)) + { + GUILayout.Label(subtext, BodyStyle); + } + } + } + GUILayout.Space(k_Space); + rect = EditorGUILayout.GetControlRect(false, 2 ); + rect.height = 2; + GUILayout.Space(k_Space); + if (GUILayout.Button("Remove Readme Assets", ButtonStyle)) + { + RemoveTutorial(); + } + } + + bool m_Initialized; + + GUIStyle TitleStyle => m_TitleStyle; + + [SerializeField] + GUIStyle m_TitleStyle; + + GUIStyle HeadingStyle => m_HeadingStyle; + + [SerializeField] + GUIStyle m_HeadingStyle; + + GUIStyle BodyStyle => m_BodyStyle; + + [SerializeField] + GUIStyle m_BodyStyle; + + GUIStyle ButtonStyle => m_ButtonStyle; + + [SerializeField] + GUIStyle m_ButtonStyle; + + void Init() + { + if (m_Initialized) + return; + m_BodyStyle = new GUIStyle(EditorStyles.label); + m_BodyStyle.wordWrap = true; + m_BodyStyle.fontSize = 14; + m_BodyStyle.richText = true; + + m_TitleStyle = new GUIStyle(m_BodyStyle); + m_TitleStyle.fontSize = 26; + + m_HeadingStyle = new GUIStyle(m_BodyStyle); + m_HeadingStyle.fontStyle = FontStyle.Bold; + m_HeadingStyle.fontSize = 18; + + m_ButtonStyle = new GUIStyle(EditorStyles.miniButton); + m_ButtonStyle.fontStyle = FontStyle.Bold; + + m_Initialized = true; + } +} diff --git a/Assets/Scripts/GameManager.cs.meta b/Samples~/SamplesGuideInfo/Scripts/Editor/ReadmeEditor.cs.meta similarity index 68% rename from Assets/Scripts/GameManager.cs.meta rename to Samples~/SamplesGuideInfo/Scripts/Editor/ReadmeEditor.cs.meta index 0f8fd3b..f038618 100644 --- a/Assets/Scripts/GameManager.cs.meta +++ b/Samples~/SamplesGuideInfo/Scripts/Editor/ReadmeEditor.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 0ca764009f215c14caab58653ce7251a -timeCreated: 1505546796 -licenseType: Free +guid: 476cc7d7cd9874016adc216baab94a0a +timeCreated: 1484146680 +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Samples~/SamplesGuideInfo/Scripts/Readme.cs b/Samples~/SamplesGuideInfo/Scripts/Readme.cs new file mode 100644 index 0000000..694a393 --- /dev/null +++ b/Samples~/SamplesGuideInfo/Scripts/Readme.cs @@ -0,0 +1,25 @@ +// Copyright (c) Unity Technologies. +// Based on the "URP TutorialInfo ReadmeEditor.cs" script included in URP template projects. +// +// Original asset by Unity Technologies. This version has been modified to display +// a custom Readme.asset in the Inspector about how to use the Singletons package +// +// Modified by ThatAmuzak - 2025 + +using System; +using System.Collections.Generic; +using UnityEngine; + +[CreateAssetMenu(fileName = "Readme", menuName = "ScriptableObjects/Readme", order = 1)] +public class Readme : ScriptableObject +{ + public string title; + public Section[] sections; + + [Serializable] + public class Section + { + public string heading; + public List text; + } +} diff --git a/Samples~/SamplesGuideInfo/Scripts/Readme.cs.meta b/Samples~/SamplesGuideInfo/Scripts/Readme.cs.meta new file mode 100644 index 0000000..935153f --- /dev/null +++ b/Samples~/SamplesGuideInfo/Scripts/Readme.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fcf7219bab7fe46a1ad266029b2fee19 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - icon: {instanceID: 0} + executionOrder: 0 + icon: {fileID: 2800000, guid: a186f8a87ca4f4d3aa864638ad5dfb65, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/Scenes.meta b/Samples~/Scenes.meta new file mode 100644 index 0000000..316590a --- /dev/null +++ b/Samples~/Scenes.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7a33e7dcf21d4b4c9b9f058a7c61b34a +timeCreated: 1740108284 \ No newline at end of file diff --git a/Assets/Scenes/Game.unity b/Samples~/Scenes/Game.unity similarity index 56% rename from Assets/Scenes/Game.unity rename to Samples~/Scenes/Game.unity index d3500f6..da527d9 100644 --- a/Assets/Scenes/Game.unity +++ b/Samples~/Scenes/Game.unity @@ -13,7 +13,7 @@ OcclusionCullingSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 8 + serializedVersion: 10 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -38,62 +38,69 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 11 - m_GIWorkflowMode: 1 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 m_GISettings: serializedVersion: 2 m_BounceScale: 1 m_IndirectOutputScale: 1 m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 m_EnvironmentLightingMode: 0 m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 1 + m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 9 + serializedVersion: 12 m_Resolution: 2 m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 + m_AtlasSize: 1024 m_AO: 0 m_AOMaxDistance: 1 m_CompAOExponent: 1 m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 m_Padding: 2 m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 m_ReflectionCompression: 2 m_MixedBakeMode: 2 - m_BakeBackend: 0 + m_BakeBackend: 1 m_PVRSampling: 1 m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 500 + m_PVRSampleCount: 512 m_PVRBounces: 2 - m_PVRFiltering: 0 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousColorSigma: 1 - m_PVRFilteringAtrousNormalSigma: 1 - m_PVRFilteringAtrousPositionSigma: 1 - m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 + m_PVRFilteringGaussRadiusIndirect: 1 + m_PVRFilteringGaussRadiusAO: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -106,17 +113,22 @@ NavMeshSettings: cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &142967083 +--- !u!1 &816866412 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - component: {fileID: 142967085} - - component: {fileID: 142967084} + - component: {fileID: 816866414} + - component: {fileID: 816866413} m_Layer: 0 m_Name: Directional Light m_TagString: Untagged @@ -124,19 +136,21 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!108 &142967084 +--- !u!108 &816866413 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 142967083} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 816866412} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 11 m_Type: 1 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 m_Range: 10 m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 m_CookieSize: 10 m_Shadows: m_Type: 2 @@ -146,6 +160,24 @@ Light: m_Bias: 0.05 m_NormalBias: 0.4 m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -153,52 +185,48 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 4 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 - m_FalloffTable: - m_Table[0]: 0 - m_Table[1]: 0 - m_Table[2]: 0 - m_Table[3]: 0 - m_Table[4]: 0 - m_Table[5]: 0 - m_Table[6]: 0 - m_Table[7]: 0 - m_Table[8]: 0 - m_Table[9]: 0 - m_Table[10]: 0 - m_Table[11]: 0 - m_Table[12]: 0 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ForceVisible: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 ---- !u!4 &142967085 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 +--- !u!4 &816866414 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 142967083} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 816866412} + serializedVersion: 2 m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &1020764077 +--- !u!1 &1379872856 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - component: {fileID: 1020764082} - - component: {fileID: 1020764081} - - component: {fileID: 1020764080} - - component: {fileID: 1020764079} - - component: {fileID: 1020764078} + - component: {fileID: 1379872859} + - component: {fileID: 1379872858} + - component: {fileID: 1379872857} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -206,37 +234,39 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!81 &1020764078 +--- !u!81 &1379872857 AudioListener: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1020764077} - m_Enabled: 1 ---- !u!124 &1020764079 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1020764077} - m_Enabled: 1 ---- !u!92 &1020764080 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1020764077} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1379872856} m_Enabled: 1 ---- !u!20 &1020764081 +--- !u!20 &1379872858 Camera: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1020764077} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1379872856} m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -258,21 +288,29 @@ Camera: m_TargetEye: 3 m_HDR: 1 m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 - m_StereoMirrorMode: 0 ---- !u!4 &1020764082 +--- !u!4 &1379872859 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1020764077} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1379872856} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 1, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1379872859} + - {fileID: 816866414} diff --git a/Assets/Scenes/Game.unity.meta b/Samples~/Scenes/Game.unity.meta similarity index 53% rename from Assets/Scenes/Game.unity.meta rename to Samples~/Scenes/Game.unity.meta index eeaabdc..972a491 100644 --- a/Assets/Scenes/Game.unity.meta +++ b/Samples~/Scenes/Game.unity.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 499d8b731179029439d2ed711317b688 -timeCreated: 1505546838 -licenseType: Free +guid: 0ddcff96bc0ef8844abfa8c1f0f5c7a8 DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Scenes/Main Menu.unity b/Samples~/Scenes/Main Menu.unity similarity index 51% rename from Assets/Scenes/Main Menu.unity rename to Samples~/Scenes/Main Menu.unity index 69340ff..f7d4070 100644 --- a/Assets/Scenes/Main Menu.unity +++ b/Samples~/Scenes/Main Menu.unity @@ -13,7 +13,7 @@ OcclusionCullingSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 8 + serializedVersion: 10 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -38,62 +38,69 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 11 - m_GIWorkflowMode: 1 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 m_GISettings: serializedVersion: 2 m_BounceScale: 1 m_IndirectOutputScale: 1 m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 m_EnvironmentLightingMode: 0 m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 1 + m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 9 + serializedVersion: 12 m_Resolution: 2 m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 + m_AtlasSize: 1024 m_AO: 0 m_AOMaxDistance: 1 m_CompAOExponent: 1 m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 m_Padding: 2 m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 m_ReflectionCompression: 2 m_MixedBakeMode: 2 - m_BakeBackend: 0 + m_BakeBackend: 1 m_PVRSampling: 1 m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 500 + m_PVRSampleCount: 512 m_PVRBounces: 2 - m_PVRFiltering: 0 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousColorSigma: 1 - m_PVRFilteringAtrousNormalSigma: 1 - m_PVRFilteringAtrousPositionSigma: 1 - m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 + m_PVRFilteringGaussRadiusIndirect: 1 + m_PVRFilteringGaussRadiusAO: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -106,106 +113,22 @@ NavMeshSettings: cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &214353527 +--- !u!1 &830374137 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - component: {fileID: 214353532} - - component: {fileID: 214353531} - - component: {fileID: 214353530} - - component: {fileID: 214353529} - - component: {fileID: 214353528} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &214353528 -AudioListener: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 214353527} - m_Enabled: 1 ---- !u!124 &214353529 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 214353527} - m_Enabled: 1 ---- !u!92 &214353530 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 214353527} - m_Enabled: 1 ---- !u!20 &214353531 -Camera: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 214353527} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 - m_StereoMirrorMode: 0 ---- !u!4 &214353532 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 214353527} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &667216367 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 667216369} - - component: {fileID: 667216368} + - component: {fileID: 830374139} + - component: {fileID: 830374138} m_Layer: 0 m_Name: Test m_TagString: Untagged @@ -213,39 +136,44 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &667216368 +--- !u!114 &830374138 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 667216367} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 830374137} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3830e8558eabcdb46914e81e3114bf45, type: 3} + m_Script: {fileID: 11500000, guid: 331da87ca46643538dbc0df750b99383, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!4 &667216369 +--- !u!4 &830374139 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 667216367} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 830374137} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &877850609 +--- !u!1 &1720212551 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - component: {fileID: 877850611} - - component: {fileID: 877850610} + - component: {fileID: 1720212553} + - component: {fileID: 1720212552} + - component: {fileID: 1720212554} m_Layer: 0 m_Name: Directional Light m_TagString: Untagged @@ -253,19 +181,21 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!108 &877850610 +--- !u!108 &1720212552 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 877850609} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1720212551} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 11 m_Type: 1 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 m_Range: 10 m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 m_CookieSize: 10 m_Shadows: m_Type: 2 @@ -275,6 +205,24 @@ Light: m_Bias: 0.05 m_NormalBias: 0.4 m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -282,37 +230,156 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 4 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 - m_FalloffTable: - m_Table[0]: 0 - m_Table[1]: 0 - m_Table[2]: 0 - m_Table[3]: 0 - m_Table[4]: 0 - m_Table[5]: 0 - m_Table[6]: 0 - m_Table[7]: 0 - m_Table[8]: 0 - m_Table[9]: 0 - m_Table[10]: 0 - m_Table[11]: 0 - m_Table[12]: 0 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ForceVisible: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 ---- !u!4 &877850611 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 +--- !u!4 &1720212553 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 877850609} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1720212551} + serializedVersion: 2 m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!114 &1720212554 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1720212551} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 3 + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_LightLayerMask: 1 + m_RenderingLayers: 1 + m_CustomShadowLayers: 0 + m_ShadowLayerMask: 1 + m_ShadowRenderingLayers: 1 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 0 +--- !u!1 &1776611414 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1776611417} + - component: {fileID: 1776611416} + - component: {fileID: 1776611415} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1776611415 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1776611414} + m_Enabled: 1 +--- !u!20 &1776611416 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1776611414} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1776611417 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1776611414} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1776611417} + - {fileID: 1720212553} + - {fileID: 830374139} diff --git a/Assets/Scenes/Main Menu.unity.meta b/Samples~/Scenes/Main Menu.unity.meta similarity index 53% rename from Assets/Scenes/Main Menu.unity.meta rename to Samples~/Scenes/Main Menu.unity.meta index 124fdf1..b44d0aa 100644 --- a/Assets/Scenes/Main Menu.unity.meta +++ b/Samples~/Scenes/Main Menu.unity.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: fd897d8df8f2e6d43811bdc3fd3eb11e -timeCreated: 1505546822 -licenseType: Free +guid: 6ea71a6420da64341a3cdd2231fc6e26 DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Scenes/_Preload.unity b/Samples~/Scenes/_Preload.unity similarity index 60% rename from Assets/Scenes/_Preload.unity rename to Samples~/Scenes/_Preload.unity index 9ed566d..3a967b4 100644 --- a/Assets/Scenes/_Preload.unity +++ b/Samples~/Scenes/_Preload.unity @@ -13,7 +13,7 @@ OcclusionCullingSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 8 + serializedVersion: 10 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -38,62 +38,69 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.37311947, g: 0.38074005, b: 0.35872722, a: 1} + m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 11 - m_GIWorkflowMode: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 m_GISettings: serializedVersion: 2 m_BounceScale: 1 m_IndirectOutputScale: 1 m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 m_EnvironmentLightingMode: 0 m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 1 + m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 9 + serializedVersion: 12 m_Resolution: 2 m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 + m_AtlasSize: 1024 m_AO: 0 m_AOMaxDistance: 1 m_CompAOExponent: 1 m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 m_Padding: 2 m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 m_ReflectionCompression: 2 m_MixedBakeMode: 2 - m_BakeBackend: 0 + m_BakeBackend: 1 m_PVRSampling: 1 m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 500 + m_PVRSampleCount: 512 m_PVRBounces: 2 - m_PVRFiltering: 0 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousColorSigma: 1 - m_PVRFilteringAtrousNormalSigma: 1 - m_PVRFilteringAtrousPositionSigma: 1 - m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 + m_PVRFilteringGaussRadiusIndirect: 1 + m_PVRFilteringGaussRadiusAO: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -106,17 +113,22 @@ NavMeshSettings: cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &779268743 +--- !u!1 &203562652 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - component: {fileID: 779268745} - - component: {fileID: 779268744} + - component: {fileID: 203562653} + - component: {fileID: 203562654} m_Layer: 0 m_Name: GameManager m_TagString: Untagged @@ -124,28 +136,36 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &779268744 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 779268743} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0ca764009f215c14caab58653ce7251a, type: 3} - m_Name: - m_EditorClassIdentifier: - m_PlayerName: Hasan Bayat ---- !u!4 &779268745 +--- !u!4 &203562653 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 779268743} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 203562652} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &203562654 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 203562652} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d4c34455da4a426fb79fdb00cf3f99b1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_PlayerName: Hasan Bayat +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 203562653} diff --git a/Assets/Scenes/_Preload.unity.meta b/Samples~/Scenes/_Preload.unity.meta similarity index 53% rename from Assets/Scenes/_Preload.unity.meta rename to Samples~/Scenes/_Preload.unity.meta index 740192d..93b6c51 100644 --- a/Assets/Scenes/_Preload.unity.meta +++ b/Samples~/Scenes/_Preload.unity.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 5264bf0bd966f354a9b71d59147155c5 -timeCreated: 1505546812 -licenseType: Free +guid: 9a1cca499933f9f47ace2af7e40a5f27 DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Samples~/Scripts.meta b/Samples~/Scripts.meta new file mode 100644 index 0000000..4d99825 --- /dev/null +++ b/Samples~/Scripts.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ed8313d3d1c1485581e662df6414d08e +timeCreated: 1740108276 \ No newline at end of file diff --git a/Samples~/Scripts/GameManager.cs b/Samples~/Scripts/GameManager.cs new file mode 100644 index 0000000..84688f2 --- /dev/null +++ b/Samples~/Scripts/GameManager.cs @@ -0,0 +1,21 @@ +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace UnityCommunity.UnitySingleton.Samples +{ + public class GameManager : PersistentMonoSingleton + { + [SerializeField] + protected string m_PlayerName; + + protected virtual void Start() + { + SceneManager.LoadScene("Main Menu"); + } + + public string GetPlayerName() + { + return m_PlayerName; + } + } +} \ No newline at end of file diff --git a/Samples~/Scripts/GameManager.cs.meta b/Samples~/Scripts/GameManager.cs.meta new file mode 100644 index 0000000..f0ffa07 --- /dev/null +++ b/Samples~/Scripts/GameManager.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d4c34455da4a426fb79fdb00cf3f99b1 +timeCreated: 1740108150 \ No newline at end of file diff --git a/Samples~/Scripts/SceneGameManager.cs b/Samples~/Scripts/SceneGameManager.cs new file mode 100644 index 0000000..5876129 --- /dev/null +++ b/Samples~/Scripts/SceneGameManager.cs @@ -0,0 +1,15 @@ +using UnityEngine; + +namespace UnityCommunity.UnitySingleton.Samples +{ + public class SceneGameManager : MonoSingleton + { + [SerializeField] + protected string m_PlayerName = "NoSLoofah"; + + public string GetPlayerName() + { + return m_PlayerName; + } + } +} \ No newline at end of file diff --git a/Samples~/Scripts/SceneGameManager.cs.meta b/Samples~/Scripts/SceneGameManager.cs.meta new file mode 100644 index 0000000..ad40dba --- /dev/null +++ b/Samples~/Scripts/SceneGameManager.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6008d09c07034a338476992dc5791d31 +timeCreated: 1740108174 \ No newline at end of file diff --git a/Samples~/Scripts/SceneTest.cs b/Samples~/Scripts/SceneTest.cs new file mode 100644 index 0000000..9d6bfbb --- /dev/null +++ b/Samples~/Scripts/SceneTest.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +namespace UnityCommunity.UnitySingleton.Samples +{ + public class SceneTest : MonoBehaviour + { + void Start() + { + Debug.Log(SceneGameManager.Instance.GetPlayerName()); + } + } +} \ No newline at end of file diff --git a/Samples~/Scripts/SceneTest.cs.meta b/Samples~/Scripts/SceneTest.cs.meta new file mode 100644 index 0000000..2fa438d --- /dev/null +++ b/Samples~/Scripts/SceneTest.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: da6211688755485cac17524804aecccb +timeCreated: 1740108184 \ No newline at end of file diff --git a/Samples~/Scripts/Test.cs b/Samples~/Scripts/Test.cs new file mode 100644 index 0000000..246f611 --- /dev/null +++ b/Samples~/Scripts/Test.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +namespace UnityCommunity.UnitySingleton.Samples +{ + public class Test : MonoBehaviour + { + void Start() + { + Debug.Log(GameManager.Instance.GetPlayerName()); + } + } +} \ No newline at end of file diff --git a/Samples~/Scripts/Test.cs.meta b/Samples~/Scripts/Test.cs.meta new file mode 100644 index 0000000..38addb5 --- /dev/null +++ b/Samples~/Scripts/Test.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 331da87ca46643538dbc0df750b99383 +timeCreated: 1740108212 \ No newline at end of file diff --git a/Samples~/UnityCommunity.UnitySingleton.Samples.asmdef b/Samples~/UnityCommunity.UnitySingleton.Samples.asmdef new file mode 100644 index 0000000..35f3983 --- /dev/null +++ b/Samples~/UnityCommunity.UnitySingleton.Samples.asmdef @@ -0,0 +1,16 @@ +{ + "name": "UnityCommunity.UnitySingleton.Samples", + "rootNamespace": "UnityCommunity.UnitySingleton.Samples", + "references": [ + "UnityCommunity.UnitySingleton" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Samples~/UnityCommunity.UnitySingleton.Samples.asmdef.meta b/Samples~/UnityCommunity.UnitySingleton.Samples.asmdef.meta new file mode 100644 index 0000000..a24b33a --- /dev/null +++ b/Samples~/UnityCommunity.UnitySingleton.Samples.asmdef.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6ae01d2b31cd4efc8e8bff7d2af1c122 +timeCreated: 1740109230 \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..5a46793 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "com.unitycommunity.unitysingleton", + "version": "3.0.0", + "displayName": "Unity Singleton", + "description": "The best way to implement singleton pattern in Unity. ", + "unity": "2022.3", + "author": { + "name": "Unity Community", + "email": "hasanbayat1393@gmail.com" + }, + "scopedRegistries": [], + "changelogUrl": "https://github.com/UnityCommunity/UnitySingleton/blob/main/CHANGELOG.md", + "license": "MIT", + "licensesUrl": "https://github.com/UnityCommunity/UnitySingleton/blob/main/LICENSE", + "documentationUrl": "https://github.com/UnityCommunity/UnitySingleton/blob/main/README.md", + "samples": [ + { + "displayName": "Samples", + "description": "Sample scene with Singleton Setup. Based on a _Preload workflow", + "path": "Samples~/" + } + ] +} \ No newline at end of file diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 0000000..8a06d92 --- /dev/null +++ b/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 721d2467222d0fa44bca492aea614254 +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: