├── UserSettings
├── Search.settings
└── EditorUserSettings.asset
├── Assets
├── Resources
│ ├── BillingMode.json
│ └── BillingMode.json.meta
├── Sprites
│ ├── toggle_bg.png
│ ├── toggle_btn.png
│ ├── toggle_bg.png.meta
│ └── toggle_btn.png.meta
├── Scenes
│ └── ToggleDemo.unity.meta
├── Scenes.meta
├── Scripts.meta
├── Sprites.meta
├── Resources.meta
└── Scripts
│ ├── Lib.meta
│ ├── JCSUnity.meta
│ ├── JCSUnity
│ ├── Enum.meta
│ ├── JCS_Button.cs.meta
│ ├── JCS_Utility.cs.meta
│ ├── JCS_ColorTweener.cs.meta
│ ├── JCS_UnityObject.cs.meta
│ ├── Enum
│ │ ├── JCS_TransformType.cs.meta
│ │ ├── JCS_TweenType.cs.meta
│ │ ├── JCS_UnityObjectType.cs.meta
│ │ ├── JCS_UnityObjectType.cs
│ │ ├── JCS_TransformType.cs
│ │ └── JCS_TweenType.cs
│ ├── JCS_TransformTweener.cs.meta
│ ├── JCS_Utility.cs
│ ├── JCS_Button.cs
│ ├── JCS_ColorTweener.cs
│ └── JCS_TransformTweener.cs
│ ├── JCS_Toggle.cs.meta
│ ├── Lib
│ ├── Easing.cs.meta
│ ├── Tweener.cs.meta
│ ├── Tweener.cs
│ └── Easing.cs
│ ├── JCS_ToggleSign.cs.meta
│ ├── JCS_ToggleSign.cs
│ └── JCS_Toggle.cs
├── psd
└── toggle-on.psd
├── screenshot
└── toggle_demo.gif
├── ProjectSettings
├── ProjectVersion.txt
├── ClusterInputManager.asset
├── NetworkManager.asset
├── VersionControlSettings.asset
├── TimeManager.asset
├── EditorBuildSettings.asset
├── VFXManager.asset
├── AudioManager.asset
├── TagManager.asset
├── EditorSettings.asset
├── PresetManager.asset
├── UnityConnectSettings.asset
├── DynamicsManager.asset
├── PackageManagerSettings.asset
├── Physics2DSettings.asset
├── NavMeshAreas.asset
├── GraphicsSettings.asset
├── QualitySettings.asset
├── InputManager.asset
└── ProjectSettings.asset
├── Logs
├── shadercompiler-AssetImportWorker0.log
├── shadercompiler-UnityShaderCompiler.exe3.log
├── Packages-Update.log
├── shadercompiler-UnityShaderCompiler.exe1.log
├── shadercompiler-UnityShaderCompiler.exe2.log
└── AssetImportWorker0.log
├── .gitignore
├── LICENSE
├── README.md
└── Packages
├── manifest.json
└── packages-lock.json
/UserSettings/Search.settings:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/Assets/Resources/BillingMode.json:
--------------------------------------------------------------------------------
1 | {"androidStore":"GooglePlay"}
--------------------------------------------------------------------------------
/psd/toggle-on.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jcs090218/Unity.Toggle/HEAD/psd/toggle-on.psd
--------------------------------------------------------------------------------
/screenshot/toggle_demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jcs090218/Unity.Toggle/HEAD/screenshot/toggle_demo.gif
--------------------------------------------------------------------------------
/Assets/Sprites/toggle_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jcs090218/Unity.Toggle/HEAD/Assets/Sprites/toggle_bg.png
--------------------------------------------------------------------------------
/Assets/Sprites/toggle_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jcs090218/Unity.Toggle/HEAD/Assets/Sprites/toggle_btn.png
--------------------------------------------------------------------------------
/ProjectSettings/ProjectVersion.txt:
--------------------------------------------------------------------------------
1 | m_EditorVersion: 2021.1.1f1
2 | m_EditorVersionWithRevision: 2021.1.1f1 (6fdc41dfa55a)
3 |
--------------------------------------------------------------------------------
/UserSettings/EditorUserSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jcs090218/Unity.Toggle/HEAD/UserSettings/EditorUserSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/ClusterInputManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!236 &1
4 | ClusterInputManager:
5 | m_ObjectHideFlags: 0
6 | m_Inputs: []
7 |
--------------------------------------------------------------------------------
/Assets/Scenes/ToggleDemo.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 748c2bcaf07910b4784b23043cae3233
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Scenes.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4f704ae4b4f98ae41a0bce26658850c1
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c50b21a78864de242a0cea38fbe01f85
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Sprites.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: df471a620580e8d4e9548514306371e3
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/ProjectSettings/NetworkManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!149 &1
4 | NetworkManager:
5 | m_ObjectHideFlags: 0
6 | m_DebugLevel: 0
7 | m_Sendrate: 15
8 | m_AssetToPrefab: {}
9 |
--------------------------------------------------------------------------------
/Assets/Resources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fa413dadc5fdb944c8545c3776d9d412
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Resources/BillingMode.json.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 01e44eda5dc74de439d4e23ab523dc37
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Scripts/Lib.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e947a24cdc7dfa348b263ab9ab43f418
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 199e5a367e9d06e4d8de98235ef8e918
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/Enum.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: adc5a7860dccf63418c77dec66849e5b
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/ProjectSettings/VersionControlSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!890905787 &1
4 | VersionControlSettings:
5 | m_ObjectHideFlags: 0
6 | m_Mode: Visible Meta Files
7 | m_CollabEditorSettings:
8 | inProgressEnabled: 1
9 |
--------------------------------------------------------------------------------
/ProjectSettings/TimeManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!5 &1
4 | TimeManager:
5 | m_ObjectHideFlags: 0
6 | Fixed Timestep: 0.02
7 | Maximum Allowed Timestep: 0.1
8 | m_TimeScale: 1
9 | Maximum Particle Timestep: 0.03
10 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCS_Toggle.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: efcfdfd1b2bc4a64894049ba226ee169
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/Lib/Easing.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 84f3b249221cb6c41bab3f8a815b58c9
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/Lib/Tweener.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ec38a2b4bda23904e8cc72cdf25cb289
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCS_ToggleSign.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 041374b95ea1b8c4eb3525ad4ccf6b2c
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/JCS_Button.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3243b022787a0e8499d20f9d7b2bf0e9
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/JCS_Utility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4678334543893094bb439fcf1be34e70
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/JCS_ColorTweener.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 086af9ddf8e28774b945cb339ad12c15
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/JCS_UnityObject.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a88959b2cf47c444dbaef6011c69d67f
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/Enum/JCS_TransformType.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9161d40912f67f84c840a0d6cab8f9a8
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/Enum/JCS_TweenType.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2e874358efb293740b973c508495c8bb
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/JCS_TransformTweener.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f630280429328134e9b43e19407cad95
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/Enum/JCS_UnityObjectType.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fcab62a4c1cbcc74b9e23f1b46165177
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/ProjectSettings/EditorBuildSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1045 &1
4 | EditorBuildSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Scenes:
8 | - enabled: 1
9 | path: Assets/Scenes/SampleScene.unity
10 | guid: 99c9720ab356a0642a771bea13969a05
11 | m_configObjects: {}
12 |
--------------------------------------------------------------------------------
/Logs/shadercompiler-AssetImportWorker0.log:
--------------------------------------------------------------------------------
1 | Base path: 'C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data', plugins path 'C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data/PlaybackEngines'
2 | Cmd: initializeCompiler
3 |
4 | Unhandled exception: Protocol error - failed to read magic number (error -2147483644, transferred 0/4)
5 |
6 | Quitting shader compiler process
7 |
--------------------------------------------------------------------------------
/ProjectSettings/VFXManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!937362698 &1
4 | VFXManager:
5 | m_ObjectHideFlags: 0
6 | m_IndirectShader: {fileID: 0}
7 | m_CopyBufferShader: {fileID: 0}
8 | m_SortShader: {fileID: 0}
9 | m_StripUpdateShader: {fileID: 0}
10 | m_RenderPipeSettingsPath:
11 | m_FixedTimeStep: 0.016666668
12 | m_MaxDeltaTime: 0.05
13 | m_CompiledVersion: 0
14 | m_RuntimeVersion: 0
15 |
--------------------------------------------------------------------------------
/ProjectSettings/AudioManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!11 &1
4 | AudioManager:
5 | m_ObjectHideFlags: 0
6 | m_Volume: 1
7 | Rolloff Scale: 1
8 | Doppler Factor: 1
9 | Default Speaker Mode: 2
10 | m_SampleRate: 0
11 | m_DSPBufferSize: 1024
12 | m_VirtualVoiceCount: 512
13 | m_RealVoiceCount: 32
14 | m_SpatializerPlugin:
15 | m_AmbisonicDecoderPlugin:
16 | m_DisableAudio: 0
17 | m_VirtualizeEffects: 1
18 |
--------------------------------------------------------------------------------
/ProjectSettings/TagManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!78 &1
4 | TagManager:
5 | serializedVersion: 2
6 | tags: []
7 | layers:
8 | - Default
9 | - TransparentFX
10 | - Ignore Raycast
11 | -
12 | - Water
13 | - UI
14 | -
15 | -
16 | - PostProcessing
17 | -
18 | -
19 | -
20 | -
21 | -
22 | -
23 | -
24 | -
25 | -
26 | -
27 | -
28 | -
29 | -
30 | -
31 | -
32 | -
33 | -
34 | -
35 | -
36 | -
37 | -
38 | -
39 | -
40 | m_SortingLayers:
41 | - name: Default
42 | uniqueID: 0
43 | locked: 0
44 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/Enum/JCS_UnityObjectType.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * $File: JCS_UnityObjectType.cs $
3 | * $Date: $
4 | * $Revision: $
5 | * $Creator: Jen-Chieh Shen $
6 | * $Notice: See LICENSE.txt for modification and distribution information
7 | * Copyright (c) 2016 by Shen, Jen-Chieh $
8 | */
9 | using UnityEngine;
10 | using System.Collections;
11 |
12 |
13 | namespace JCSUnity
14 | {
15 |
16 | ///
17 | /// Unity Engine's type.
18 | ///
19 | public enum JCS_UnityObjectType
20 | {
21 | GAME_OBJECT,
22 | UI,
23 | SPRITE,
24 | TEXT
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/Enum/JCS_TransformType.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * $File: JCS_TransformType.cs $
3 | * $Date: 2017-09-10 07:06:47 $
4 | * $Revision: $
5 | * $Creator: Jen-Chieh Shen $
6 | * $Notice: See LICENSE.txt for modification and distribution information
7 | * Copyright (c) 2017 by Shen, Jen-Chieh $
8 | */
9 | using System.Collections;
10 | using System.Collections.Generic;
11 | using UnityEngine;
12 |
13 |
14 | namespace JCSUnity
15 | {
16 | ///
17 | /// List of transform properties.
18 | ///
19 | public enum JCS_TransformType
20 | {
21 | POSITION,
22 | ROTATION,
23 | SCALE
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # ignore the those directory
2 | /.git
3 | /.vs
4 | /Temp
5 | /Build
6 | /Library
7 | /obj
8 | /Tutorials
9 | /Publish
10 | /Assets/Libraries
11 |
12 | # don't include the video.
13 | /Video
14 |
15 | # ignore scripts file
16 | *.bat
17 | *.sh
18 |
19 | # ignore the following extension file
20 | *.svd
21 | *.userprefs
22 | *.csproj
23 | *.pidb
24 | *.suo
25 | *.sln
26 | *.user
27 | *.unityproj
28 | *.booproj
29 | *.orig
30 | *.app
31 | *.exe
32 | *.*_data
33 | .vsconfig
34 |
35 | # Unity3D generated meta files
36 | *.pidb.meta
37 |
38 | # Unity3D Generated File On Crash Reports
39 | sysinfo.txt
40 |
41 | # ignore mac attribute file
42 | *.DS_Store
43 |
44 | # Builds
45 | *.apk
46 | *.unitypackage
47 |
--------------------------------------------------------------------------------
/ProjectSettings/EditorSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!159 &1
4 | EditorSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 7
7 | m_ExternalVersionControlSupport: Visible Meta Files
8 | m_SerializationMode: 2
9 | m_LineEndingsForNewScripts: 2
10 | m_DefaultBehaviorMode: 0
11 | m_SpritePackerMode: 0
12 | m_SpritePackerPaddingPower: 1
13 | m_EtcTextureCompressorBehavior: 1
14 | m_EtcTextureFastCompressor: 1
15 | m_EtcTextureNormalCompressor: 2
16 | m_EtcTextureBestCompressor: 4
17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd
18 | m_ProjectGenerationRootNamespace:
19 | m_UserGeneratedProjectSuffix:
20 | m_CollabEditorSettings:
21 | inProgressEnabled: 1
22 |
--------------------------------------------------------------------------------
/ProjectSettings/PresetManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1386491679 &1
4 | PresetManager:
5 | m_ObjectHideFlags: 0
6 | m_DefaultList:
7 | - type:
8 | m_NativeTypeID: 108
9 | m_ManagedTypePPtr: {fileID: 0}
10 | m_ManagedTypeFallback:
11 | defaultPresets:
12 | - m_Preset: {fileID: 2655988077585873504, guid: c1cf8506f04ef2c4a88b64b6c4202eea,
13 | type: 2}
14 | - type:
15 | m_NativeTypeID: 1020
16 | m_ManagedTypePPtr: {fileID: 0}
17 | m_ManagedTypeFallback:
18 | defaultPresets:
19 | - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6,
20 | type: 2}
21 | - type:
22 | m_NativeTypeID: 1006
23 | m_ManagedTypePPtr: {fileID: 0}
24 | m_ManagedTypeFallback:
25 | defaultPresets:
26 | - m_Preset: {fileID: 2655988077585873504, guid: 7a99f8aa944efe94cb9bd74562b7d5f9,
27 | type: 2}
28 |
--------------------------------------------------------------------------------
/ProjectSettings/UnityConnectSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!310 &1
4 | UnityConnectSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 1
7 | m_Enabled: 0
8 | m_TestMode: 0
9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events
10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events
11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com
12 | m_TestInitMode: 0
13 | CrashReportingSettings:
14 | m_EventUrl: https://perf-events.cloud.unity3d.com
15 | m_Enabled: 1
16 | m_LogBufferSize: 10
17 | m_CaptureEditorExceptions: 1
18 | UnityPurchasingSettings:
19 | m_Enabled: 0
20 | m_TestMode: 0
21 | UnityAnalyticsSettings:
22 | m_Enabled: 1
23 | m_TestMode: 0
24 | m_InitializeOnStartup: 1
25 | UnityAdsSettings:
26 | m_Enabled: 0
27 | m_InitializeOnStartup: 1
28 | m_TestMode: 0
29 | m_IosGameId:
30 | m_AndroidGameId:
31 | m_GameIds: {}
32 | m_GameId:
33 | PerformanceReportingSettings:
34 | m_Enabled: 0
35 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2018-2022 Jen-Chieh Shen
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
20 |
--------------------------------------------------------------------------------
/ProjectSettings/DynamicsManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!55 &1
4 | PhysicsManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 7
7 | m_Gravity: {x: 0, y: -9.81, z: 0}
8 | m_DefaultMaterial: {fileID: 0}
9 | m_BounceThreshold: 2
10 | m_SleepThreshold: 0.005
11 | m_DefaultContactOffset: 0.01
12 | m_DefaultSolverIterations: 6
13 | m_DefaultSolverVelocityIterations: 1
14 | m_QueriesHitBackfaces: 0
15 | m_QueriesHitTriggers: 1
16 | m_EnableAdaptiveForce: 0
17 | m_ClothInterCollisionDistance: 0
18 | m_ClothInterCollisionStiffness: 0
19 | m_ContactsGeneration: 1
20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
21 | m_AutoSimulation: 1
22 | m_AutoSyncTransforms: 1
23 | m_ClothInterCollisionSettingsToggle: 0
24 | m_ContactPairsMode: 0
25 | m_BroadphaseType: 0
26 | m_WorldBounds:
27 | m_Center: {x: 0, y: 0, z: 0}
28 | m_Extent: {x: 250, y: 250, z: 250}
29 | m_WorldSubdivisions: 8
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://opensource.org/licenses/MIT)
2 | [](https://unity3d.com/get-unity/download/archive)
3 |
4 | # Unity Toggle
5 |
6 | [](https://travis-ci.com/jcs090218/Unity_Toggle)
7 |
8 |
9 |
10 | A little bit overkill iOS style toggle button.
11 |
12 | ## 🔨 Usage
13 |
14 | ```cs
15 | JCS_Toggle togBtn = this.GetComponent();
16 |
17 | // Check if the toggle is on or off?
18 | bool isOn = togBtn.IsOn;
19 |
20 | // Toggle the button.
21 | togBtn.Toggle();
22 |
23 | // Set interactable.
24 | togBtn.Interactable = !togBtn.Interactable;
25 | ```
26 |
27 | ## 📌 Dependencies
28 |
29 | * [JCSUnity](https://github.com/jcs090218/JCSUnity) by [Jen-Chieh Shen](https://github.com/jcs090218)
30 | * [Tweener](https://github.com/PeterVuorela/Tweener) by [Peter Vuorela](https://github.com/PeterVuorela)
31 |
32 | ## 🔗 Related Tool
33 |
34 | * [Unity-Toggle-controller](https://github.com/Kalxoznik/Unity-Toggle-controller) by [Max Shakurov](https://github.com/Kalxoznik)
35 |
--------------------------------------------------------------------------------
/Logs/shadercompiler-UnityShaderCompiler.exe3.log:
--------------------------------------------------------------------------------
1 | Base path: 'C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data', plugins path 'C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data/PlaybackEngines'
2 | Cmd: initializeCompiler
3 |
4 | Cmd: compileSnippet
5 | insize=2865 file=Assets/DefaultResourcesExtra/UI/UI/Default pass=Default cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW= dKW=UNITY_UI_CLIP_RECT UNITY_UI_ALPHACLIP UNITY_NO_DXT5nm UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 flags=0 lang=0 type=Fragment platform=d3d11 reqs=1 mask=6 start=49 ok=1 outsize=518
6 |
7 | Cmd: shutdown
8 |
--------------------------------------------------------------------------------
/ProjectSettings/PackageManagerSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &1
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 61
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0}
13 | m_Name:
14 | m_EditorClassIdentifier:
15 | m_EnablePreReleasePackages: 0
16 | m_EnablePackageDependencies: 0
17 | m_AdvancedSettingsExpanded: 1
18 | m_ScopedRegistriesSettingsExpanded: 1
19 | m_SeeAllPackageVersions: 0
20 | oneTimeWarningShown: 0
21 | m_Registries:
22 | - m_Id: main
23 | m_Name:
24 | m_Url: https://packages.unity.com
25 | m_Scopes: []
26 | m_IsDefault: 1
27 | m_Capabilities: 7
28 | m_UserSelectedRegistryName:
29 | m_UserAddingNewScopedRegistry: 0
30 | m_RegistryInfoDraft:
31 | m_ErrorMessage:
32 | m_Original:
33 | m_Id:
34 | m_Name:
35 | m_Url:
36 | m_Scopes: []
37 | m_IsDefault: 0
38 | m_Capabilities: 0
39 | m_Modified: 0
40 | m_Name:
41 | m_Url:
42 | m_Scopes:
43 | -
44 | m_SelectedScopeIndex: 0
45 | m_LoadAssets: 0
46 |
--------------------------------------------------------------------------------
/Logs/Packages-Update.log:
--------------------------------------------------------------------------------
1 |
2 | === Tue Feb 26 23:46:18 2019
3 |
4 | Packages were changed.
5 | Update Mode: updateDependencies
6 |
7 | The following packages were added:
8 | com.unity.collab-proxy@1.2.15
9 | The following packages were updated:
10 | com.unity.analytics from version 2.0.16 to 3.2.2
11 | com.unity.package-manager-ui from version 1.9.11 to 2.0.3
12 | com.unity.textmeshpro from version 1.2.4 to 1.3.0
13 |
14 | === Wed May 26 00:12:59 2021
15 |
16 | Packages were changed.
17 | Update Mode: updateDependencies
18 |
19 | The following packages were added:
20 | com.unity.2d.sprite@1.0.0
21 | com.unity.2d.tilemap@1.0.0
22 | com.unity.ide.rider@3.0.5
23 | com.unity.ide.visualstudio@2.0.7
24 | com.unity.ide.vscode@1.2.3
25 | com.unity.modules.androidjni@1.0.0
26 | com.unity.test-framework@1.1.24
27 | com.unity.timeline@1.5.2
28 | com.unity.ugui@1.0.0
29 | com.unity.xr.legacyinputhelpers@2.1.7
30 | The following packages were updated:
31 | com.unity.ads from version 2.0.8 to 3.5.2
32 | com.unity.analytics from version 3.2.2 to 3.5.3
33 | com.unity.collab-proxy from version 1.2.15 to 1.3.9
34 | com.unity.purchasing from version 2.0.3 to 3.0.1
35 | com.unity.textmeshpro from version 1.3.0 to 3.0.4
36 | The following packages were removed:
37 | com.unity.package-manager-ui@2.0.3
38 |
--------------------------------------------------------------------------------
/Logs/shadercompiler-UnityShaderCompiler.exe1.log:
--------------------------------------------------------------------------------
1 | Base path: 'C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data', plugins path 'C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data/PlaybackEngines'
2 | Cmd: initializeCompiler
3 |
4 | Cmd: compileSnippet
5 | insize=659 file=Packages/com.unity.textmeshpro/Editor Resources/Shaders/Hidden/TMP/Internal/Editor/Distance Field SSD pass= cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW= dKW=OUTLINE_ON UNDERLAY_ON UNDERLAY_INNER UNITY_NO_DXT5nm UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 flags=0 lang=0 type=Vertex platform=d3d11 reqs=33 mask=6 start=58 ok=1 outsize=1974
6 |
7 | Cmd: initializeCompiler
8 |
9 | Cmd: shutdown
10 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/Enum/JCS_TweenType.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * $File: JCS_TweenType.cs $
3 | * $Date: $
4 | * $Revision: $
5 | * $Creator: Jen-Chieh Shen $
6 | * $Notice: See LICENSE.txt for modification and distribution information
7 | * Copyright (c) 2016 by Shen, Jen-Chieh $
8 | */
9 | using UnityEngine;
10 | using System.Collections;
11 |
12 |
13 | namespace JCSUnity
14 | {
15 |
16 | ///
17 | ///
18 | ///
19 | public enum JCS_TweenType
20 | {
21 | LINEAR, // default
22 |
23 | EASE_IN_SINE,
24 | EASE_IN_CUBIC,
25 | EASE_IN_QUINT,
26 | EASE_IN_CIRC,
27 | EASE_IN_BACK,
28 | EASE_OUT_SINE,
29 | EASE_OUT_CUBIC,
30 | EASE_OUT_QUINT,
31 | EASE_OUT_CIRC,
32 | EASE_OUT_BACK,
33 | EASE_IN_OUT_SINE,
34 | EASE_IN_OUT_CUBIC,
35 | EASE_IN_OUT_QUINT,
36 | EASE_IN_OUT_CIRC,
37 | EASE_IN_OUT_BACK,
38 | EASE_IN_QUAD,
39 | EASE_IN_QUART,
40 | EASE_IN_EXPO,
41 | EASE_IN_ELASTIC,
42 | EASE_IN_BOUNCE,
43 | EASE_OUT_QUAD,
44 | EASE_OUT_QUART,
45 | EASE_OUT_EXPO,
46 | EASE_OUT_ELASTIC,
47 | EASE_OUT_BOUNCE,
48 | EASE_IN_OUT_QUAD,
49 | EASE_IN_OUT_QUART,
50 | EASE_IN_OUT_EXPO,
51 | EASE_IN_OUT_ELASTIC,
52 | EASE_IN_OUT_BOUNCE
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/ProjectSettings/Physics2DSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!19 &1
4 | Physics2DSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 3
7 | m_Gravity: {x: 0, y: -9.81}
8 | m_DefaultMaterial: {fileID: 0}
9 | m_VelocityIterations: 8
10 | m_PositionIterations: 3
11 | m_VelocityThreshold: 1
12 | m_MaxLinearCorrection: 0.2
13 | m_MaxAngularCorrection: 8
14 | m_MaxTranslationSpeed: 100
15 | m_MaxRotationSpeed: 360
16 | m_BaumgarteScale: 0.2
17 | m_BaumgarteTimeOfImpactScale: 0.75
18 | m_TimeToSleep: 0.5
19 | m_LinearSleepTolerance: 0.01
20 | m_AngularSleepTolerance: 2
21 | m_DefaultContactOffset: 0.01
22 | m_AutoSimulation: 1
23 | m_QueriesHitTriggers: 1
24 | m_QueriesStartInColliders: 1
25 | m_ChangeStopsCallbacks: 0
26 | m_CallbacksOnDisable: 1
27 | m_AutoSyncTransforms: 1
28 | m_AlwaysShowColliders: 0
29 | m_ShowColliderSleep: 1
30 | m_ShowColliderContacts: 0
31 | m_ShowColliderAABB: 0
32 | m_ContactArrowScale: 0.2
33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
38 |
--------------------------------------------------------------------------------
/ProjectSettings/NavMeshAreas.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!126 &1
4 | NavMeshProjectSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | areas:
8 | - name: Walkable
9 | cost: 1
10 | - name: Not Walkable
11 | cost: 1
12 | - name: Jump
13 | cost: 2
14 | - name:
15 | cost: 1
16 | - name:
17 | cost: 1
18 | - name:
19 | cost: 1
20 | - name:
21 | cost: 1
22 | - name:
23 | cost: 1
24 | - name:
25 | cost: 1
26 | - name:
27 | cost: 1
28 | - name:
29 | cost: 1
30 | - name:
31 | cost: 1
32 | - name:
33 | cost: 1
34 | - name:
35 | cost: 1
36 | - name:
37 | cost: 1
38 | - name:
39 | cost: 1
40 | - name:
41 | cost: 1
42 | - name:
43 | cost: 1
44 | - name:
45 | cost: 1
46 | - name:
47 | cost: 1
48 | - name:
49 | cost: 1
50 | - name:
51 | cost: 1
52 | - name:
53 | cost: 1
54 | - name:
55 | cost: 1
56 | - name:
57 | cost: 1
58 | - name:
59 | cost: 1
60 | - name:
61 | cost: 1
62 | - name:
63 | cost: 1
64 | - name:
65 | cost: 1
66 | - name:
67 | cost: 1
68 | - name:
69 | cost: 1
70 | - name:
71 | cost: 1
72 | m_LastAgentTypeID: -887442657
73 | m_Settings:
74 | - serializedVersion: 2
75 | agentTypeID: 0
76 | agentRadius: 0.5
77 | agentHeight: 2
78 | agentSlope: 45
79 | agentClimb: 0.75
80 | ledgeDropHeight: 0
81 | maxJumpAcrossDistance: 0
82 | minRegionArea: 2
83 | manualCellSize: 0
84 | cellSize: 0.16666667
85 | manualTileSize: 0
86 | tileSize: 256
87 | accuratePlacement: 0
88 | debug:
89 | m_Flags: 0
90 | m_SettingNames:
91 | - Humanoid
92 |
--------------------------------------------------------------------------------
/Packages/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "com.unity.2d.sprite": "1.0.0",
4 | "com.unity.2d.tilemap": "1.0.0",
5 | "com.unity.ads": "3.5.2",
6 | "com.unity.analytics": "3.5.3",
7 | "com.unity.collab-proxy": "1.3.9",
8 | "com.unity.ide.rider": "3.0.5",
9 | "com.unity.ide.visualstudio": "2.0.7",
10 | "com.unity.ide.vscode": "1.2.3",
11 | "com.unity.purchasing": "3.0.1",
12 | "com.unity.test-framework": "1.1.24",
13 | "com.unity.textmeshpro": "3.0.4",
14 | "com.unity.timeline": "1.5.2",
15 | "com.unity.toolchain.win-x86_64-linux-x86_64": "0.1.20-preview",
16 | "com.unity.ugui": "1.0.0",
17 | "com.unity.xr.legacyinputhelpers": "2.1.7",
18 | "com.unity.modules.ai": "1.0.0",
19 | "com.unity.modules.androidjni": "1.0.0",
20 | "com.unity.modules.animation": "1.0.0",
21 | "com.unity.modules.assetbundle": "1.0.0",
22 | "com.unity.modules.audio": "1.0.0",
23 | "com.unity.modules.cloth": "1.0.0",
24 | "com.unity.modules.director": "1.0.0",
25 | "com.unity.modules.imageconversion": "1.0.0",
26 | "com.unity.modules.imgui": "1.0.0",
27 | "com.unity.modules.jsonserialize": "1.0.0",
28 | "com.unity.modules.particlesystem": "1.0.0",
29 | "com.unity.modules.physics": "1.0.0",
30 | "com.unity.modules.physics2d": "1.0.0",
31 | "com.unity.modules.screencapture": "1.0.0",
32 | "com.unity.modules.terrain": "1.0.0",
33 | "com.unity.modules.terrainphysics": "1.0.0",
34 | "com.unity.modules.tilemap": "1.0.0",
35 | "com.unity.modules.ui": "1.0.0",
36 | "com.unity.modules.uielements": "1.0.0",
37 | "com.unity.modules.umbra": "1.0.0",
38 | "com.unity.modules.unityanalytics": "1.0.0",
39 | "com.unity.modules.unitywebrequest": "1.0.0",
40 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
41 | "com.unity.modules.unitywebrequestaudio": "1.0.0",
42 | "com.unity.modules.unitywebrequesttexture": "1.0.0",
43 | "com.unity.modules.unitywebrequestwww": "1.0.0",
44 | "com.unity.modules.vehicles": "1.0.0",
45 | "com.unity.modules.video": "1.0.0",
46 | "com.unity.modules.vr": "1.0.0",
47 | "com.unity.modules.wind": "1.0.0",
48 | "com.unity.modules.xr": "1.0.0"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Logs/shadercompiler-UnityShaderCompiler.exe2.log:
--------------------------------------------------------------------------------
1 | Base path: 'C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data', plugins path 'C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data/PlaybackEngines'
2 | Cmd: initializeCompiler
3 |
4 | Cmd: compileSnippet
5 | insize=659 file=Packages/com.unity.textmeshpro/Editor Resources/Shaders/Hidden/TMP/Internal/Editor/Distance Field SSD pass= cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW= dKW=OUTLINE_ON UNDERLAY_ON UNDERLAY_INNER UNITY_NO_DXT5nm UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 flags=0 lang=0 type=Fragment platform=d3d11 reqs=33 mask=6 start=58 ok=1 outsize=906
6 |
7 | Cmd: initializeCompiler
8 |
9 | Cmd: compileSnippet
10 | insize=2865 file=Assets/DefaultResourcesExtra/UI/UI/Default pass=Default cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW= dKW=UNITY_UI_CLIP_RECT UNITY_UI_ALPHACLIP UNITY_NO_DXT5nm UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 flags=0 lang=0 type=Vertex platform=d3d11 reqs=1 mask=6 start=49 ok=1 outsize=1306
11 |
12 | Cmd: shutdown
13 |
--------------------------------------------------------------------------------
/ProjectSettings/GraphicsSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!30 &1
4 | GraphicsSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 12
7 | m_Deferred:
8 | m_Mode: 1
9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
10 | m_DeferredReflections:
11 | m_Mode: 1
12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
13 | m_ScreenSpaceShadows:
14 | m_Mode: 1
15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
16 | m_LegacyDeferred:
17 | m_Mode: 1
18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
19 | m_DepthNormals:
20 | m_Mode: 1
21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
22 | m_MotionVectors:
23 | m_Mode: 1
24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
25 | m_LightHalo:
26 | m_Mode: 1
27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
28 | m_LensFlare:
29 | m_Mode: 1
30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
31 | m_AlwaysIncludedShaders:
32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
38 | m_PreloadedShaders: []
39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
40 | type: 0}
41 | m_CustomRenderPipeline: {fileID: 0}
42 | m_TransparencySortMode: 0
43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1}
44 | m_DefaultRenderingPath: 1
45 | m_DefaultMobileRenderingPath: 1
46 | m_TierSettings: []
47 | m_LightmapStripping: 0
48 | m_FogStripping: 0
49 | m_InstancingStripping: 0
50 | m_LightmapKeepPlain: 1
51 | m_LightmapKeepDirCombined: 1
52 | m_LightmapKeepDynamicPlain: 1
53 | m_LightmapKeepDynamicDirCombined: 1
54 | m_LightmapKeepShadowMask: 1
55 | m_LightmapKeepSubtractive: 1
56 | m_FogKeepLinear: 1
57 | m_FogKeepExp: 1
58 | m_FogKeepExp2: 1
59 | m_AlbedoSwatchInfos: []
60 | m_LightsUseLinearIntensity: 0
61 | m_LightsUseColorTemperature: 0
62 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCS_ToggleSign.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * $File: JCS_ToggleSign.cs $
3 | * $Date: 2018-08-21 23:11:05 $
4 | * $Revision: $
5 | * $Creator: Jen-Chieh Shen $
6 | * $Notice: See LICENSE.txt for modification and distribution information
7 | * Copyright © 2018 by Shen, Jen-Chieh $
8 | */
9 | using System.Collections;
10 | using System.Collections.Generic;
11 | using UnityEngine;
12 |
13 |
14 | namespace JCSUnity
15 | {
16 | ///
17 | /// Sign of the toggle button.
18 | ///
19 | [RequireComponent(typeof(JCS_TransformTweener))]
20 | [RequireComponent(typeof(JCS_ColorTweener))]
21 | public class JCS_ToggleSign
22 | : MonoBehaviour
23 | {
24 |
25 | /*******************************************/
26 | /* Public Variables */
27 | /*******************************************/
28 |
29 | /*******************************************/
30 | /* Private Variables */
31 | /*******************************************/
32 |
33 | private JCS_TransformTweener mTransformTweener = null;
34 |
35 | private JCS_ColorTweener mColorTweener = null;
36 |
37 | /*******************************************/
38 | /* Protected Variables */
39 | /*******************************************/
40 |
41 | /*******************************************/
42 | /* setter / getter */
43 | /*******************************************/
44 | public JCS_TransformTweener TransformTweener { get { return this.mTransformTweener; } }
45 | public JCS_ColorTweener ColorTweener { get { return this.mColorTweener; } }
46 |
47 | /*******************************************/
48 | /* Unity's function */
49 | /*******************************************/
50 | private void Awake()
51 | {
52 | this.mTransformTweener = this.GetComponent();
53 | this.mColorTweener = this.GetComponent();
54 | }
55 |
56 | /*******************************************/
57 | /* Self-Define */
58 | /*******************************************/
59 | //----------------------
60 | // Public Functions
61 |
62 | //----------------------
63 | // Protected Functions
64 |
65 | //----------------------
66 | // Private Functions
67 |
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/Assets/Sprites/toggle_bg.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ee96c748d52ff864ba320bc35f43b06c
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 11
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | vTOnly: 0
27 | grayScaleToAlpha: 0
28 | generateCubemap: 6
29 | cubemapConvolution: 0
30 | seamlessCubemap: 0
31 | textureFormat: 1
32 | maxTextureSize: 2048
33 | textureSettings:
34 | serializedVersion: 2
35 | filterMode: -1
36 | aniso: -1
37 | mipBias: -100
38 | wrapU: 1
39 | wrapV: 1
40 | wrapW: -1
41 | nPOTScale: 0
42 | lightmap: 0
43 | compressionQuality: 50
44 | spriteMode: 1
45 | spriteExtrude: 1
46 | spriteMeshType: 1
47 | alignment: 0
48 | spritePivot: {x: 0.5, y: 0.5}
49 | spritePixelsToUnits: 100
50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
51 | spriteGenerateFallbackPhysicsShape: 1
52 | alphaUsage: 1
53 | alphaIsTransparency: 1
54 | spriteTessellationDetail: -1
55 | textureType: 8
56 | textureShape: 1
57 | singleChannelComponent: 0
58 | flipbookRows: 1
59 | flipbookColumns: 1
60 | maxTextureSizeSet: 0
61 | compressionQualitySet: 0
62 | textureFormatSet: 0
63 | ignorePngGamma: 0
64 | applyGammaDecoding: 1
65 | platformSettings:
66 | - serializedVersion: 3
67 | buildTarget: DefaultTexturePlatform
68 | maxTextureSize: 2048
69 | resizeAlgorithm: 0
70 | textureFormat: -1
71 | textureCompression: 1
72 | compressionQuality: 50
73 | crunchedCompression: 0
74 | allowsAlphaSplitting: 0
75 | overridden: 0
76 | androidETC2FallbackOverride: 0
77 | forceMaximumCompressionQuality_BC6H_BC7: 1
78 | - serializedVersion: 3
79 | buildTarget: Standalone
80 | maxTextureSize: 2048
81 | resizeAlgorithm: 0
82 | textureFormat: -1
83 | textureCompression: 1
84 | compressionQuality: 50
85 | crunchedCompression: 0
86 | allowsAlphaSplitting: 0
87 | overridden: 0
88 | androidETC2FallbackOverride: 0
89 | forceMaximumCompressionQuality_BC6H_BC7: 1
90 | - serializedVersion: 3
91 | buildTarget: iPhone
92 | maxTextureSize: 2048
93 | resizeAlgorithm: 0
94 | textureFormat: -1
95 | textureCompression: 1
96 | compressionQuality: 50
97 | crunchedCompression: 0
98 | allowsAlphaSplitting: 0
99 | overridden: 0
100 | androidETC2FallbackOverride: 0
101 | forceMaximumCompressionQuality_BC6H_BC7: 1
102 | - serializedVersion: 3
103 | buildTarget: Android
104 | maxTextureSize: 2048
105 | resizeAlgorithm: 0
106 | textureFormat: -1
107 | textureCompression: 1
108 | compressionQuality: 50
109 | crunchedCompression: 0
110 | allowsAlphaSplitting: 0
111 | overridden: 0
112 | androidETC2FallbackOverride: 0
113 | forceMaximumCompressionQuality_BC6H_BC7: 1
114 | - serializedVersion: 3
115 | buildTarget: WebGL
116 | maxTextureSize: 2048
117 | resizeAlgorithm: 0
118 | textureFormat: -1
119 | textureCompression: 1
120 | compressionQuality: 50
121 | crunchedCompression: 0
122 | allowsAlphaSplitting: 0
123 | overridden: 0
124 | androidETC2FallbackOverride: 0
125 | forceMaximumCompressionQuality_BC6H_BC7: 1
126 | spriteSheet:
127 | serializedVersion: 2
128 | sprites: []
129 | outline: []
130 | physicsShape: []
131 | bones: []
132 | spriteID: 5e97eb03825dee720800000000000000
133 | internalID: 0
134 | vertices: []
135 | indices:
136 | edges: []
137 | weights: []
138 | secondaryTextures: []
139 | spritePackingTag:
140 | pSDRemoveMatte: 0
141 | pSDShowRemoveMatteOption: 0
142 | userData:
143 | assetBundleName:
144 | assetBundleVariant:
145 |
--------------------------------------------------------------------------------
/Assets/Sprites/toggle_btn.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a6e334a7f9a16bc45b4b15c3d99a6fcb
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 11
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | vTOnly: 0
27 | grayScaleToAlpha: 0
28 | generateCubemap: 6
29 | cubemapConvolution: 0
30 | seamlessCubemap: 0
31 | textureFormat: 1
32 | maxTextureSize: 2048
33 | textureSettings:
34 | serializedVersion: 2
35 | filterMode: -1
36 | aniso: -1
37 | mipBias: -100
38 | wrapU: 1
39 | wrapV: 1
40 | wrapW: -1
41 | nPOTScale: 0
42 | lightmap: 0
43 | compressionQuality: 50
44 | spriteMode: 1
45 | spriteExtrude: 1
46 | spriteMeshType: 1
47 | alignment: 0
48 | spritePivot: {x: 0.5, y: 0.5}
49 | spritePixelsToUnits: 100
50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
51 | spriteGenerateFallbackPhysicsShape: 1
52 | alphaUsage: 1
53 | alphaIsTransparency: 1
54 | spriteTessellationDetail: -1
55 | textureType: 8
56 | textureShape: 1
57 | singleChannelComponent: 0
58 | flipbookRows: 1
59 | flipbookColumns: 1
60 | maxTextureSizeSet: 0
61 | compressionQualitySet: 0
62 | textureFormatSet: 0
63 | ignorePngGamma: 0
64 | applyGammaDecoding: 1
65 | platformSettings:
66 | - serializedVersion: 3
67 | buildTarget: DefaultTexturePlatform
68 | maxTextureSize: 2048
69 | resizeAlgorithm: 0
70 | textureFormat: -1
71 | textureCompression: 1
72 | compressionQuality: 50
73 | crunchedCompression: 0
74 | allowsAlphaSplitting: 0
75 | overridden: 0
76 | androidETC2FallbackOverride: 0
77 | forceMaximumCompressionQuality_BC6H_BC7: 1
78 | - serializedVersion: 3
79 | buildTarget: Standalone
80 | maxTextureSize: 2048
81 | resizeAlgorithm: 0
82 | textureFormat: -1
83 | textureCompression: 1
84 | compressionQuality: 50
85 | crunchedCompression: 0
86 | allowsAlphaSplitting: 0
87 | overridden: 0
88 | androidETC2FallbackOverride: 0
89 | forceMaximumCompressionQuality_BC6H_BC7: 1
90 | - serializedVersion: 3
91 | buildTarget: iPhone
92 | maxTextureSize: 2048
93 | resizeAlgorithm: 0
94 | textureFormat: -1
95 | textureCompression: 1
96 | compressionQuality: 50
97 | crunchedCompression: 0
98 | allowsAlphaSplitting: 0
99 | overridden: 0
100 | androidETC2FallbackOverride: 0
101 | forceMaximumCompressionQuality_BC6H_BC7: 1
102 | - serializedVersion: 3
103 | buildTarget: Android
104 | maxTextureSize: 2048
105 | resizeAlgorithm: 0
106 | textureFormat: -1
107 | textureCompression: 1
108 | compressionQuality: 50
109 | crunchedCompression: 0
110 | allowsAlphaSplitting: 0
111 | overridden: 0
112 | androidETC2FallbackOverride: 0
113 | forceMaximumCompressionQuality_BC6H_BC7: 1
114 | - serializedVersion: 3
115 | buildTarget: WebGL
116 | maxTextureSize: 2048
117 | resizeAlgorithm: 0
118 | textureFormat: -1
119 | textureCompression: 1
120 | compressionQuality: 50
121 | crunchedCompression: 0
122 | allowsAlphaSplitting: 0
123 | overridden: 0
124 | androidETC2FallbackOverride: 0
125 | forceMaximumCompressionQuality_BC6H_BC7: 1
126 | spriteSheet:
127 | serializedVersion: 2
128 | sprites: []
129 | outline: []
130 | physicsShape: []
131 | bones: []
132 | spriteID: 5e97eb03825dee720800000000000000
133 | internalID: 0
134 | vertices: []
135 | indices:
136 | edges: []
137 | weights: []
138 | secondaryTextures: []
139 | spritePackingTag:
140 | pSDRemoveMatte: 0
141 | pSDShowRemoveMatteOption: 0
142 | userData:
143 | assetBundleName:
144 | assetBundleVariant:
145 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/JCS_Utility.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * $File: JCS_Utility.cs $
3 | * $Date: $
4 | * $Revision: $
5 | * $Creator: Jen-Chieh Shen $
6 | * $Notice: See LICENSE.txt for modification and distribution information
7 | * Copyright (c) 2016 by Shen, Jen-Chieh $
8 | */
9 | using UnityEngine;
10 | using System.Collections;
11 | using UnityEngine.UI;
12 | using UnityEngine.EventSystems;
13 | using System.Linq;
14 | using PeterVuorela.Tweener;
15 | using System.Collections.Generic;
16 |
17 |
18 | namespace JCSUnity
19 | {
20 |
21 | ///
22 | /// All the utility function put here.
23 | ///
24 | public class JCS_Utility
25 | : MonoBehaviour
26 | {
27 | ///
28 | /// Return the easing function pointer base on tweener type.
29 | ///
30 | /// type of the tween formula
31 | /// function pointer
32 | public static TweenDelegate GetEasing(JCS_TweenType type)
33 | {
34 | TweenDelegate easing = null;
35 |
36 | switch (type)
37 | {
38 | // default to linear
39 | case JCS_TweenType.LINEAR:
40 | easing = Easing.Linear;
41 | break;
42 |
43 | case JCS_TweenType.EASE_IN_SINE:
44 | easing = Easing.SineEaseIn;
45 | break;
46 | case JCS_TweenType.EASE_IN_CUBIC:
47 | easing = Easing.CubicEaseIn;
48 | break;
49 | case JCS_TweenType.EASE_IN_QUINT:
50 | easing = Easing.QuintEaseIn;
51 | break;
52 | case JCS_TweenType.EASE_IN_CIRC:
53 | easing = Easing.CircEaseIn;
54 | break;
55 | case JCS_TweenType.EASE_IN_BACK:
56 | easing = Easing.BackEaseIn;
57 | break;
58 | case JCS_TweenType.EASE_OUT_SINE:
59 | easing = Easing.SineEaseInOut;
60 | break;
61 | case JCS_TweenType.EASE_OUT_CUBIC:
62 | easing = Easing.CubicEaseInOut;
63 | break;
64 | case JCS_TweenType.EASE_OUT_QUINT:
65 | easing = Easing.QuintEaseInOut;
66 | break;
67 | case JCS_TweenType.EASE_OUT_CIRC:
68 | easing = Easing.CircEaseOut;
69 | break;
70 | case JCS_TweenType.EASE_OUT_BACK:
71 | easing = Easing.BackEaseOut;
72 | break;
73 | case JCS_TweenType.EASE_IN_OUT_SINE:
74 | easing = Easing.SineEaseInOut;
75 | break;
76 | case JCS_TweenType.EASE_IN_OUT_CUBIC:
77 | easing = Easing.CubicEaseInOut;
78 | break;
79 | case JCS_TweenType.EASE_IN_OUT_QUINT:
80 | easing = Easing.QuintEaseInOut;
81 | break;
82 | case JCS_TweenType.EASE_IN_OUT_CIRC:
83 | easing = Easing.CircEaseInOut;
84 | break;
85 | case JCS_TweenType.EASE_IN_OUT_BACK:
86 | easing = Easing.BackEaseInOut;
87 | break;
88 | case JCS_TweenType.EASE_IN_QUAD:
89 | easing = Easing.QuadEaseIn;
90 | break;
91 | case JCS_TweenType.EASE_IN_QUART:
92 | easing = Easing.QuartEaseIn;
93 | break;
94 | case JCS_TweenType.EASE_IN_EXPO:
95 | easing = Easing.ExpoEaseIn;
96 | break;
97 | case JCS_TweenType.EASE_IN_ELASTIC:
98 | easing = Easing.ElasticEaseIn;
99 | break;
100 | case JCS_TweenType.EASE_IN_BOUNCE:
101 | easing = Easing.BounceEaseIn;
102 | break;
103 | case JCS_TweenType.EASE_OUT_QUAD:
104 | easing = Easing.QuadEaseInOut;
105 | break;
106 | case JCS_TweenType.EASE_OUT_QUART:
107 | easing = Easing.QuartEaseOut;
108 | break;
109 | case JCS_TweenType.EASE_OUT_EXPO:
110 | easing = Easing.ExpoEaseInOut;
111 | break;
112 | case JCS_TweenType.EASE_OUT_ELASTIC:
113 | easing = Easing.ElasticEaseOut;
114 | break;
115 | case JCS_TweenType.EASE_OUT_BOUNCE:
116 | easing = Easing.BounceEaseOut;
117 | break;
118 | case JCS_TweenType.EASE_IN_OUT_QUAD:
119 | easing = Easing.QuadEaseInOut;
120 | break;
121 | case JCS_TweenType.EASE_IN_OUT_QUART:
122 | easing = Easing.QuartEaseInOut;
123 | break;
124 | case JCS_TweenType.EASE_IN_OUT_EXPO:
125 | easing = Easing.ExpoEaseInOut;
126 | break;
127 | case JCS_TweenType.EASE_IN_OUT_ELASTIC:
128 | easing = Easing.ElasticEaseInOut;
129 | break;
130 | case JCS_TweenType.EASE_IN_OUT_BOUNCE:
131 | easing = Easing.BounceEaseInOut;
132 | break;
133 | }
134 |
135 | return easing;
136 | }
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/ProjectSettings/QualitySettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!47 &1
4 | QualitySettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 5
7 | m_CurrentQuality: 4
8 | m_QualitySettings:
9 | - serializedVersion: 2
10 | name: Very Low
11 | pixelLightCount: 0
12 | shadows: 0
13 | shadowResolution: 0
14 | shadowProjection: 1
15 | shadowCascades: 1
16 | shadowDistance: 15
17 | shadowNearPlaneOffset: 3
18 | shadowCascade2Split: 0.33333334
19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
20 | shadowmaskMode: 0
21 | blendWeights: 1
22 | textureQuality: 1
23 | anisotropicTextures: 0
24 | antiAliasing: 0
25 | softParticles: 0
26 | softVegetation: 0
27 | realtimeReflectionProbes: 0
28 | billboardsFaceCameraPosition: 0
29 | vSyncCount: 0
30 | lodBias: 0.3
31 | maximumLODLevel: 0
32 | particleRaycastBudget: 4
33 | asyncUploadTimeSlice: 2
34 | asyncUploadBufferSize: 4
35 | resolutionScalingFixedDPIFactor: 1
36 | excludedTargetPlatforms: []
37 | - serializedVersion: 2
38 | name: Low
39 | pixelLightCount: 0
40 | shadows: 0
41 | shadowResolution: 0
42 | shadowProjection: 1
43 | shadowCascades: 1
44 | shadowDistance: 20
45 | shadowNearPlaneOffset: 3
46 | shadowCascade2Split: 0.33333334
47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
48 | shadowmaskMode: 0
49 | blendWeights: 2
50 | textureQuality: 0
51 | anisotropicTextures: 0
52 | antiAliasing: 0
53 | softParticles: 0
54 | softVegetation: 0
55 | realtimeReflectionProbes: 0
56 | billboardsFaceCameraPosition: 0
57 | vSyncCount: 0
58 | lodBias: 0.4
59 | maximumLODLevel: 0
60 | particleRaycastBudget: 16
61 | asyncUploadTimeSlice: 2
62 | asyncUploadBufferSize: 4
63 | resolutionScalingFixedDPIFactor: 1
64 | excludedTargetPlatforms: []
65 | - serializedVersion: 2
66 | name: Medium
67 | pixelLightCount: 1
68 | shadows: 1
69 | shadowResolution: 0
70 | shadowProjection: 1
71 | shadowCascades: 1
72 | shadowDistance: 20
73 | shadowNearPlaneOffset: 3
74 | shadowCascade2Split: 0.33333334
75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
76 | shadowmaskMode: 0
77 | blendWeights: 2
78 | textureQuality: 0
79 | anisotropicTextures: 1
80 | antiAliasing: 0
81 | softParticles: 0
82 | softVegetation: 0
83 | realtimeReflectionProbes: 0
84 | billboardsFaceCameraPosition: 0
85 | vSyncCount: 1
86 | lodBias: 0.7
87 | maximumLODLevel: 0
88 | particleRaycastBudget: 64
89 | asyncUploadTimeSlice: 2
90 | asyncUploadBufferSize: 4
91 | resolutionScalingFixedDPIFactor: 1
92 | excludedTargetPlatforms: []
93 | - serializedVersion: 2
94 | name: High
95 | pixelLightCount: 2
96 | shadows: 2
97 | shadowResolution: 1
98 | shadowProjection: 1
99 | shadowCascades: 2
100 | shadowDistance: 40
101 | shadowNearPlaneOffset: 3
102 | shadowCascade2Split: 0.33333334
103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
104 | shadowmaskMode: 1
105 | blendWeights: 2
106 | textureQuality: 0
107 | anisotropicTextures: 1
108 | antiAliasing: 2
109 | softParticles: 0
110 | softVegetation: 1
111 | realtimeReflectionProbes: 1
112 | billboardsFaceCameraPosition: 1
113 | vSyncCount: 1
114 | lodBias: 1
115 | maximumLODLevel: 0
116 | particleRaycastBudget: 256
117 | asyncUploadTimeSlice: 2
118 | asyncUploadBufferSize: 4
119 | resolutionScalingFixedDPIFactor: 1
120 | excludedTargetPlatforms: []
121 | - serializedVersion: 2
122 | name: Very High
123 | pixelLightCount: 3
124 | shadows: 2
125 | shadowResolution: 2
126 | shadowProjection: 1
127 | shadowCascades: 2
128 | shadowDistance: 40
129 | shadowNearPlaneOffset: 3
130 | shadowCascade2Split: 0.33333334
131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
132 | shadowmaskMode: 1
133 | blendWeights: 4
134 | textureQuality: 0
135 | anisotropicTextures: 1
136 | antiAliasing: 4
137 | softParticles: 1
138 | softVegetation: 1
139 | realtimeReflectionProbes: 1
140 | billboardsFaceCameraPosition: 1
141 | vSyncCount: 1
142 | lodBias: 1.5
143 | maximumLODLevel: 0
144 | particleRaycastBudget: 1024
145 | asyncUploadTimeSlice: 2
146 | asyncUploadBufferSize: 4
147 | resolutionScalingFixedDPIFactor: 1
148 | excludedTargetPlatforms: []
149 | - serializedVersion: 2
150 | name: Ultra
151 | pixelLightCount: 4
152 | shadows: 2
153 | shadowResolution: 2
154 | shadowProjection: 1
155 | shadowCascades: 4
156 | shadowDistance: 150
157 | shadowNearPlaneOffset: 3
158 | shadowCascade2Split: 0.33333334
159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
160 | shadowmaskMode: 1
161 | blendWeights: 4
162 | textureQuality: 0
163 | anisotropicTextures: 1
164 | antiAliasing: 4
165 | softParticles: 1
166 | softVegetation: 1
167 | realtimeReflectionProbes: 1
168 | billboardsFaceCameraPosition: 1
169 | vSyncCount: 1
170 | lodBias: 2
171 | maximumLODLevel: 0
172 | particleRaycastBudget: 4096
173 | asyncUploadTimeSlice: 2
174 | asyncUploadBufferSize: 4
175 | resolutionScalingFixedDPIFactor: 1
176 | excludedTargetPlatforms: []
177 | m_PerPlatformDefaultQuality:
178 | Android: 2
179 | Nintendo 3DS: 5
180 | Nintendo Switch: 5
181 | PS4: 5
182 | PSP2: 2
183 | Standalone: 5
184 | Tizen: 2
185 | WebGL: 3
186 | WiiU: 5
187 | Windows Store Apps: 5
188 | XboxOne: 5
189 | iPhone: 2
190 | tvOS: 2
191 |
--------------------------------------------------------------------------------
/Logs/AssetImportWorker0.log:
--------------------------------------------------------------------------------
1 | Using pre-set license
2 | Built from '2021.1/release' branch; Version is '2021.1.1f1 (6fdc41dfa55a) revision 7330881'; Using compiler version '192528614'; Build Type 'Release'
3 | OS: 'Windows 10 Pro; OS build 19042.985; Version 2009; 64bit' Language: 'en' Physical Memory: 32681 MB
4 | BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 0
5 |
6 | COMMAND LINE ARGUMENTS:
7 | C:\Program Files\Unity\Hub\Editor\2021.1.1f1\Editor\Unity.exe
8 | -adb2
9 | -batchMode
10 | -noUpm
11 | -name
12 | AssetImportWorker0
13 | -projectPath
14 | C:/DB_Enterp/Asia/TW/ALDES/ENT/BaseEngine/Unity/Toggle
15 | -logFile
16 | Logs/AssetImportWorker0.log
17 | -srvPort
18 | 59515
19 | Successfully changed project path to: C:/DB_Enterp/Asia/TW/ALDES/ENT/BaseEngine/Unity/Toggle
20 | C:/DB_Enterp/Asia/TW/ALDES/ENT/BaseEngine/Unity/Toggle
21 | Using Asset Import Pipeline V2.
22 | Refreshing native plugins compatible for Editor in 48.71 ms, found 0 plugins.
23 | Preloading 0 native plugins for Editor in 0.00 ms.
24 | Initialize engine version: 2021.1.1f1 (6fdc41dfa55a)
25 | [Subsystems] Discovering subsystems at path C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data/Resources/UnitySubsystems
26 | [Subsystems] Discovering subsystems at path C:/DB_Enterp/Asia/TW/ALDES/ENT/BaseEngine/Unity/Toggle/Assets
27 | GfxDevice: creating device client; threaded=0; jobified=0
28 | Direct3D:
29 | Version: Direct3D 11.0 [level 11.1]
30 | Renderer: NVIDIA GeForce RTX 2080 SUPER (ID=0x1e81)
31 | Vendor: NVIDIA
32 | VRAM: 8010 MB
33 | Driver: 27.21.14.6589
34 | Initialize mono
35 | Mono path[0] = 'C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data/Managed'
36 | Mono path[1] = 'C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data/MonoBleedingEdge/lib/mono/unityjit'
37 | Mono config path = 'C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data/MonoBleedingEdge/etc'
38 | Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56232
39 | Begin MonoManager ReloadAssembly
40 | Registering precompiled unity dll's ...
41 | Register platform support module: C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll
42 | Register platform support module: C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll
43 | Register platform support module: C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll
44 | Register platform support module: C:/Program Files/Unity/Hub/Editor/2021.1.1f1/Editor/Data/PlaybackEngines/LinuxStandaloneSupport/UnityEditor.LinuxStandalone.Extensions.dll
45 | Registered in 0.006714 seconds.
46 | Native extension for LinuxStandalone target not found
47 | Native extension for WindowsStandalone target not found
48 | Native extension for OSXStandalone target not found
49 | Native extension for WebGL target not found
50 | Refreshing native plugins compatible for Editor in 42.21 ms, found 0 plugins.
51 | Preloading 0 native plugins for Editor in 0.00 ms.
52 | Mono: successfully reloaded assembly
53 | - Completed reload, in 2.170 seconds
54 | Platform modules already initialized, skipping
55 | Registering precompiled user dll's ...
56 | Registered in 0.003287 seconds.
57 | Begin MonoManager ReloadAssembly
58 | Native extension for LinuxStandalone target not found
59 | Native extension for WindowsStandalone target not found
60 | Native extension for OSXStandalone target not found
61 | Native extension for WebGL target not found
62 | Refreshing native plugins compatible for Editor in 0.50 ms, found 0 plugins.
63 | Preloading 0 native plugins for Editor in 0.00 ms.
64 | Mono: successfully reloaded assembly
65 | - Completed reload, in 0.960 seconds
66 | Platform modules already initialized, skipping
67 | ========================================================================
68 | Worker process is ready to serve import requests
69 | Launched and connected shader compiler UnityShaderCompiler.exe after 0.06 seconds
70 | Refreshing native plugins compatible for Editor in 0.48 ms, found 0 plugins.
71 | Preloading 0 native plugins for Editor in 0.00 ms.
72 | Unloading 1666 Unused Serialized files (Serialized files now loaded: 0)
73 | System memory in use before: 72.5 MB.
74 | System memory in use after: 72.6 MB.
75 |
76 | Unloading 42 unused Assets to reduce memory usage. Loaded Objects now: 2103.
77 | Total: 5.407200 ms (FindLiveObjects: 0.306700 ms CreateObjectMapping: 0.052500 ms MarkObjects: 4.980000 ms DeleteObjects: 0.066900 ms)
78 |
79 | ========================================================================
80 | Received Import Request.
81 | path: Assets/Scripts/JCS_ToggleSign.cs
82 | artifactKey: Guid(041374b95ea1b8c4eb3525ad4ccf6b2c) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
83 | Start importing Assets/Scripts/JCS_ToggleSign.cs using Guid(041374b95ea1b8c4eb3525ad4ccf6b2c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'ccf30ecc3796b8c41e06c49fe5ea8fbe') in 0.031088 seconds
84 | ========================================================================
85 | Received Import Request.
86 | Time since last request: 0.000749 seconds.
87 | path: Assets/Scripts
88 | artifactKey: Guid(c50b21a78864de242a0cea38fbe01f85) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
89 | Start importing Assets/Scripts using Guid(c50b21a78864de242a0cea38fbe01f85) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'ec865d402564f95d1449f509370c1c62') in 0.003551 seconds
90 | ========================================================================
91 | Received Prepare
92 | Registering precompiled user dll's ...
93 | Registered in 0.002075 seconds.
94 | Begin MonoManager ReloadAssembly
95 | Native extension for LinuxStandalone target not found
96 | Native extension for WindowsStandalone target not found
97 | Native extension for OSXStandalone target not found
98 | Native extension for WebGL target not found
99 | Refreshing native plugins compatible for Editor in 0.50 ms, found 0 plugins.
100 | Preloading 0 native plugins for Editor in 0.00 ms.
101 | Mono: successfully reloaded assembly
102 | - Completed reload, in 0.826 seconds
103 | Platform modules already initialized, skipping
104 | Refreshing native plugins compatible for Editor in 0.32 ms, found 0 plugins.
105 | Preloading 0 native plugins for Editor in 0.00 ms.
106 | Unloading 1660 Unused Serialized files (Serialized files now loaded: 0)
107 | System memory in use before: 72.4 MB.
108 | System memory in use after: 72.5 MB.
109 |
110 | Unloading 33 unused Assets to reduce memory usage. Loaded Objects now: 2106.
111 | Total: 5.109700 ms (FindLiveObjects: 0.169500 ms CreateObjectMapping: 0.035900 ms MarkObjects: 4.875000 ms DeleteObjects: 0.027900 ms)
112 |
113 | AssetImportWorkerClient::OnTransportError - code=2 error=End of file
114 |
--------------------------------------------------------------------------------
/ProjectSettings/InputManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!13 &1
4 | InputManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Axes:
8 | - serializedVersion: 3
9 | m_Name: Horizontal
10 | descriptiveName:
11 | descriptiveNegativeName:
12 | negativeButton: left
13 | positiveButton: right
14 | altNegativeButton: a
15 | altPositiveButton: d
16 | gravity: 3
17 | dead: 0.001
18 | sensitivity: 3
19 | snap: 1
20 | invert: 0
21 | type: 0
22 | axis: 0
23 | joyNum: 0
24 | - serializedVersion: 3
25 | m_Name: Vertical
26 | descriptiveName:
27 | descriptiveNegativeName:
28 | negativeButton: down
29 | positiveButton: up
30 | altNegativeButton: s
31 | altPositiveButton: w
32 | gravity: 3
33 | dead: 0.001
34 | sensitivity: 3
35 | snap: 1
36 | invert: 0
37 | type: 0
38 | axis: 0
39 | joyNum: 0
40 | - serializedVersion: 3
41 | m_Name: Fire1
42 | descriptiveName:
43 | descriptiveNegativeName:
44 | negativeButton:
45 | positiveButton: left ctrl
46 | altNegativeButton:
47 | altPositiveButton: mouse 0
48 | gravity: 1000
49 | dead: 0.001
50 | sensitivity: 1000
51 | snap: 0
52 | invert: 0
53 | type: 0
54 | axis: 0
55 | joyNum: 0
56 | - serializedVersion: 3
57 | m_Name: Fire2
58 | descriptiveName:
59 | descriptiveNegativeName:
60 | negativeButton:
61 | positiveButton: left alt
62 | altNegativeButton:
63 | altPositiveButton: mouse 1
64 | gravity: 1000
65 | dead: 0.001
66 | sensitivity: 1000
67 | snap: 0
68 | invert: 0
69 | type: 0
70 | axis: 0
71 | joyNum: 0
72 | - serializedVersion: 3
73 | m_Name: Fire3
74 | descriptiveName:
75 | descriptiveNegativeName:
76 | negativeButton:
77 | positiveButton: left shift
78 | altNegativeButton:
79 | altPositiveButton: mouse 2
80 | gravity: 1000
81 | dead: 0.001
82 | sensitivity: 1000
83 | snap: 0
84 | invert: 0
85 | type: 0
86 | axis: 0
87 | joyNum: 0
88 | - serializedVersion: 3
89 | m_Name: Jump
90 | descriptiveName:
91 | descriptiveNegativeName:
92 | negativeButton:
93 | positiveButton: space
94 | altNegativeButton:
95 | altPositiveButton:
96 | gravity: 1000
97 | dead: 0.001
98 | sensitivity: 1000
99 | snap: 0
100 | invert: 0
101 | type: 0
102 | axis: 0
103 | joyNum: 0
104 | - serializedVersion: 3
105 | m_Name: Mouse X
106 | descriptiveName:
107 | descriptiveNegativeName:
108 | negativeButton:
109 | positiveButton:
110 | altNegativeButton:
111 | altPositiveButton:
112 | gravity: 0
113 | dead: 0
114 | sensitivity: 0.1
115 | snap: 0
116 | invert: 0
117 | type: 1
118 | axis: 0
119 | joyNum: 0
120 | - serializedVersion: 3
121 | m_Name: Mouse Y
122 | descriptiveName:
123 | descriptiveNegativeName:
124 | negativeButton:
125 | positiveButton:
126 | altNegativeButton:
127 | altPositiveButton:
128 | gravity: 0
129 | dead: 0
130 | sensitivity: 0.1
131 | snap: 0
132 | invert: 0
133 | type: 1
134 | axis: 1
135 | joyNum: 0
136 | - serializedVersion: 3
137 | m_Name: Mouse ScrollWheel
138 | descriptiveName:
139 | descriptiveNegativeName:
140 | negativeButton:
141 | positiveButton:
142 | altNegativeButton:
143 | altPositiveButton:
144 | gravity: 0
145 | dead: 0
146 | sensitivity: 0.1
147 | snap: 0
148 | invert: 0
149 | type: 1
150 | axis: 2
151 | joyNum: 0
152 | - serializedVersion: 3
153 | m_Name: Horizontal
154 | descriptiveName:
155 | descriptiveNegativeName:
156 | negativeButton:
157 | positiveButton:
158 | altNegativeButton:
159 | altPositiveButton:
160 | gravity: 0
161 | dead: 0.19
162 | sensitivity: 1
163 | snap: 0
164 | invert: 0
165 | type: 2
166 | axis: 0
167 | joyNum: 0
168 | - serializedVersion: 3
169 | m_Name: Vertical
170 | descriptiveName:
171 | descriptiveNegativeName:
172 | negativeButton:
173 | positiveButton:
174 | altNegativeButton:
175 | altPositiveButton:
176 | gravity: 0
177 | dead: 0.19
178 | sensitivity: 1
179 | snap: 0
180 | invert: 1
181 | type: 2
182 | axis: 1
183 | joyNum: 0
184 | - serializedVersion: 3
185 | m_Name: Fire1
186 | descriptiveName:
187 | descriptiveNegativeName:
188 | negativeButton:
189 | positiveButton: joystick button 0
190 | altNegativeButton:
191 | altPositiveButton:
192 | gravity: 1000
193 | dead: 0.001
194 | sensitivity: 1000
195 | snap: 0
196 | invert: 0
197 | type: 0
198 | axis: 0
199 | joyNum: 0
200 | - serializedVersion: 3
201 | m_Name: Fire2
202 | descriptiveName:
203 | descriptiveNegativeName:
204 | negativeButton:
205 | positiveButton: joystick button 1
206 | altNegativeButton:
207 | altPositiveButton:
208 | gravity: 1000
209 | dead: 0.001
210 | sensitivity: 1000
211 | snap: 0
212 | invert: 0
213 | type: 0
214 | axis: 0
215 | joyNum: 0
216 | - serializedVersion: 3
217 | m_Name: Fire3
218 | descriptiveName:
219 | descriptiveNegativeName:
220 | negativeButton:
221 | positiveButton: joystick button 2
222 | altNegativeButton:
223 | altPositiveButton:
224 | gravity: 1000
225 | dead: 0.001
226 | sensitivity: 1000
227 | snap: 0
228 | invert: 0
229 | type: 0
230 | axis: 0
231 | joyNum: 0
232 | - serializedVersion: 3
233 | m_Name: Jump
234 | descriptiveName:
235 | descriptiveNegativeName:
236 | negativeButton:
237 | positiveButton: joystick button 3
238 | altNegativeButton:
239 | altPositiveButton:
240 | gravity: 1000
241 | dead: 0.001
242 | sensitivity: 1000
243 | snap: 0
244 | invert: 0
245 | type: 0
246 | axis: 0
247 | joyNum: 0
248 | - serializedVersion: 3
249 | m_Name: Submit
250 | descriptiveName:
251 | descriptiveNegativeName:
252 | negativeButton:
253 | positiveButton: return
254 | altNegativeButton:
255 | altPositiveButton: joystick button 0
256 | gravity: 1000
257 | dead: 0.001
258 | sensitivity: 1000
259 | snap: 0
260 | invert: 0
261 | type: 0
262 | axis: 0
263 | joyNum: 0
264 | - serializedVersion: 3
265 | m_Name: Submit
266 | descriptiveName:
267 | descriptiveNegativeName:
268 | negativeButton:
269 | positiveButton: enter
270 | altNegativeButton:
271 | altPositiveButton: space
272 | gravity: 1000
273 | dead: 0.001
274 | sensitivity: 1000
275 | snap: 0
276 | invert: 0
277 | type: 0
278 | axis: 0
279 | joyNum: 0
280 | - serializedVersion: 3
281 | m_Name: Cancel
282 | descriptiveName:
283 | descriptiveNegativeName:
284 | negativeButton:
285 | positiveButton: escape
286 | altNegativeButton:
287 | altPositiveButton: joystick button 1
288 | gravity: 1000
289 | dead: 0.001
290 | sensitivity: 1000
291 | snap: 0
292 | invert: 0
293 | type: 0
294 | axis: 0
295 | joyNum: 0
296 |
--------------------------------------------------------------------------------
/Assets/Scripts/Lib/Tweener.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 | using JCSUnity;
4 |
5 |
6 | namespace PeterVuorela.Tweener
7 | {
8 |
9 | ///
10 | /// Vector 3 Tweening, handle progression.
11 | ///
12 | public class Vector3Tweener
13 | {
14 | private CallBackDelegate _Callback = null;
15 |
16 | private TweenDelegate _EasingX = null;
17 | private TweenDelegate _EasingY = null;
18 | private TweenDelegate _EasingZ = null;
19 |
20 | private Vector3 _From = Vector3.zero;
21 | private Vector3 _To = Vector3.zero;
22 |
23 |
24 | private Vector3 _ProgressPct = Vector3.zero;
25 |
26 | public Vector3 progressPct { get { return _ProgressPct; } }
27 |
28 | private bool _AnimatingX = false;
29 | private bool _AnimatingY = false;
30 | private bool _AnimatingZ = false;
31 |
32 | private Vector3 _TimeElapsed = Vector3.zero;
33 |
34 | private Vector3 _Duration = Vector3.one;
35 |
36 | private Vector3 _Progression = Vector3.zero;
37 |
38 | ///
39 | /// Callback when reach destination.
40 | ///
41 | /// function pointer
42 | public void SetCallback(CallBackDelegate func)
43 | {
44 | if (func == null)
45 | return;
46 |
47 | this._Callback += func;
48 | }
49 |
50 | public Vector3Tweener() { }
51 |
52 | ///
53 | /// Eases from value to value.
54 | ///
55 | /// From.
56 | /// To.
57 | /// Duration.
58 | /// Easing.
59 | public void easeFromTo(
60 | Vector3 from, Vector3 to,
61 | bool resetElapsedTime = true,
62 | float durationX = 1f,
63 | float durationY = 1f,
64 | float durationZ = 1f,
65 | TweenDelegate easingX = null,
66 | TweenDelegate easingY = null,
67 | TweenDelegate easingZ = null,
68 | CallBackDelegate callback = null)
69 | {
70 | if (easingX == null)
71 | {
72 | // give the default value
73 | easingX = Easing.Linear;
74 | }
75 |
76 | if (easingY == null)
77 | {
78 | // give the default value
79 | easingY = Easing.Linear;
80 | }
81 |
82 | if (easingZ == null)
83 | {
84 | // give the default value
85 | easingZ = Easing.Linear;
86 | }
87 |
88 | _EasingX = easingX;
89 | _EasingY = easingY;
90 | _EasingZ = easingZ;
91 | SetCallback(callback);
92 |
93 | _From = from;
94 | _To = to;
95 |
96 | _Duration.x = durationX;
97 | _ProgressPct.x = 0f;
98 |
99 | _Duration.y = durationY;
100 | _ProgressPct.y = 0f;
101 |
102 | _Duration.z = durationZ;
103 | _ProgressPct.z = 0f;
104 |
105 | _AnimatingX = true;
106 | _AnimatingY = true;
107 | _AnimatingZ = true;
108 |
109 | if (resetElapsedTime)
110 | {
111 | _TimeElapsed.x = 0f;
112 | _TimeElapsed.y = 0f;
113 | _TimeElapsed.z = 0f;
114 | }
115 | }
116 |
117 | public void updateX(bool callCallBack = true)
118 | {
119 | if (!_AnimatingX)
120 | return;
121 |
122 | if (_TimeElapsed.x < _Duration.x)
123 | {
124 | if (_EasingX != null)
125 | {
126 | _Progression.x = _EasingX.Invoke(_TimeElapsed.x, _From.x, (_To.x - _From.x), _Duration.x);
127 |
128 | _ProgressPct.x = _TimeElapsed.x / _Duration.x;
129 |
130 | _TimeElapsed.x += Time.deltaTime;
131 | }
132 | }
133 | else
134 | {
135 | _Progression.x = _To.x;
136 |
137 | _AnimatingX = false;
138 | _TimeElapsed.x = 0f;
139 | _ProgressPct.x = 1f;
140 |
141 | CheckUpdate();
142 | }
143 | }
144 | public void updateY(bool callCallBack = true)
145 | {
146 | if (!_AnimatingY)
147 | return;
148 |
149 | if (_TimeElapsed.y < _Duration.y)
150 | {
151 | if (_EasingY != null)
152 | {
153 | _Progression.y = _EasingY.Invoke(_TimeElapsed.y, _From.y, (_To.y - _From.y), _Duration.y);
154 |
155 | _ProgressPct.y = _TimeElapsed.y / _Duration.y;
156 |
157 | _TimeElapsed.y += Time.deltaTime;
158 | }
159 | }
160 | else
161 | {
162 | _Progression.y = _To.y;
163 |
164 | _AnimatingY = false;
165 | _TimeElapsed.y = 0f;
166 | _ProgressPct.y = 1f;
167 |
168 | CheckUpdate();
169 | }
170 | }
171 | public void updateZ(bool callCallBack = true)
172 | {
173 | if (!_AnimatingZ)
174 | return;
175 |
176 | if (_TimeElapsed.z < _Duration.z)
177 | {
178 | if (_EasingZ != null)
179 | {
180 | _Progression.z = _EasingZ.Invoke(_TimeElapsed.z, _From.z, (_To.z - _From.z), _Duration.z);
181 |
182 | _ProgressPct.z = _TimeElapsed.z / _Duration.z;
183 |
184 | _TimeElapsed.z += Time.deltaTime;
185 | }
186 | }
187 | else
188 | {
189 | _Progression.z = _To.z;
190 |
191 | _AnimatingZ = false;
192 | _TimeElapsed.z = 0f;
193 | _ProgressPct.z = 1f;
194 |
195 | CheckUpdate();
196 | }
197 | }
198 |
199 | public void CheckUpdate(bool callCallBack = true)
200 | {
201 | if (_AnimatingX && _AnimatingY && _AnimatingZ)
202 | return;
203 |
204 | if (callCallBack && _Callback != null)
205 | {
206 | _Callback.Invoke();
207 | }
208 | }
209 |
210 | ///
211 | /// Reset tweener effect setting.
212 | ///
213 | public void ResetTweener()
214 | {
215 | _Progression.x = _To.x;
216 | _AnimatingX = false;
217 | _TimeElapsed.x = 0f;
218 | _ProgressPct.x = 1f;
219 |
220 | _Progression.y = _To.y;
221 | _AnimatingY = false;
222 | _TimeElapsed.y = 0f;
223 | _ProgressPct.y = 1f;
224 |
225 | _Progression.z = _To.z;
226 | _AnimatingZ = false;
227 | _TimeElapsed.z = 0f;
228 | _ProgressPct.z = 1f;
229 | }
230 |
231 | public void updateX(ref Vector2 whatToTween)
232 | {
233 | bool wasAnimating = _AnimatingX;
234 | updateX(false);
235 | whatToTween = _Progression;
236 |
237 | if (wasAnimating && !_AnimatingX && _Callback != null)
238 | {
239 | _Callback.Invoke();
240 | }
241 |
242 | }
243 |
244 | public void updateY(ref Vector2 whatToTween)
245 | {
246 | bool wasAnimating = _AnimatingY;
247 | updateY(false);
248 | whatToTween = _Progression;
249 |
250 | if (wasAnimating && !_AnimatingY && _Callback != null)
251 | {
252 | _Callback.Invoke();
253 | }
254 |
255 | }
256 |
257 | public void updateZ(ref Vector2 whatToTween)
258 | {
259 | bool wasAnimating = _AnimatingZ;
260 | updateZ(false);
261 | whatToTween = _Progression;
262 |
263 | if (wasAnimating && !_AnimatingZ && _Callback != null)
264 | {
265 | _Callback.Invoke();
266 | }
267 | }
268 |
269 | public void DoCallBack()
270 | {
271 | if (_Callback != null)
272 | _Callback.Invoke();
273 | }
274 |
275 | public bool animating { get { return (_AnimatingX || _AnimatingY || _AnimatingZ); } }
276 | public Vector3 progression { get { return _Progression; } }
277 | public Vector3 from { get { return _From; } set { _From = value; } }
278 | public Vector3 to { get { return _To; } set { _To = value; } }
279 | }
280 | }
281 |
--------------------------------------------------------------------------------
/Assets/Scripts/JCSUnity/JCS_Button.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * $File: JCS_Button.cs $
3 | * $Date: $
4 | * $Revision: $
5 | * $Creator: Jen-Chieh Shen $
6 | * $Notice: See LICENSE.txt for modification and distribution information
7 | * Copyright (c) 2016 by Shen, Jen-Chieh $
8 | */
9 | using UnityEngine;
10 | using System.Collections;
11 | using UnityEngine.UI;
12 |
13 | namespace JCSUnity
14 | {
15 |
16 | ///
17 | /// Buttton Interface (NGUI)
18 | ///
19 | [RequireComponent(typeof(RectTransform))]
20 | [RequireComponent(typeof(Button))]
21 | [RequireComponent(typeof(Image))]
22 | public abstract class JCS_Button
23 | : MonoBehaviour
24 | {
25 |
26 | /*******************************************/
27 | /* Public Variables */
28 | /*******************************************/
29 | public delegate void CallBackFunc();
30 | public delegate void CallBackFuncBtn(JCS_Button btn);
31 | public delegate void CallBackFuncBtnInt(int selection);
32 |
33 | // JCSUnity framework only callback, do not override this callback.
34 | public CallBackFunc btnSystemCallBack = null;
35 | public CallBackFuncBtn btnSystemCallBackBtn = null;
36 | public CallBackFuncBtnInt btnSystemCallBackBtnInt = null;
37 | // for user's callback.
38 | public CallBackFunc btnCallBack = null;
39 | public CallBackFuncBtn btnCallBackBtn = null;
40 |
41 | public CallBackFunc interactableCallback = null;
42 |
43 | /*******************************************/
44 | /* Private Variables */
45 | /*******************************************/
46 |
47 | [Header("** Check Variables (JCS_Button) **")]
48 |
49 | [Tooltip("Record down the selection choice for dialogue system.")]
50 | [SerializeField]
51 | private int mDialogueSelection = -1;
52 |
53 | private bool mInitialized = false;
54 |
55 | /*******************************************/
56 | /* Protected Variables */
57 | /*******************************************/
58 |
59 | [Header("** Optional Variables (JCS_Button) **")]
60 |
61 | [Tooltip("text under the button, no necessary.")]
62 | [SerializeField]
63 | protected Text mButtonText = null;
64 |
65 |
66 | [Header("** Initialize Variables (JCS_Button) **")]
67 |
68 | [Tooltip("Auto add listner to button click event?")]
69 | [SerializeField] protected bool mAutoListener = true;
70 | [Tooltip("Index pairing with Dialogue, in order to call the correct index.")]
71 | [SerializeField] protected int mDialogueIndex = -1;
72 |
73 |
74 | [Header("** Runtime Variables (JCS_Button) **")]
75 |
76 | [Tooltip("Is the button interactable or not. (Default: true)")]
77 | [SerializeField]
78 | protected bool mInteractable = true;
79 |
80 | [Tooltip("Color tint when button is interactable.")]
81 | [SerializeField]
82 | protected Color mInteractColor = new Color(1, 1, 1, 1);
83 |
84 | [Tooltip("Color tint when button is not interactable.")]
85 | [SerializeField]
86 | protected Color mNotInteractColor = new Color(1, 1, 1, 0.5f);
87 |
88 |
89 | protected RectTransform mRectTransform = null;
90 | protected Button mButton = null;
91 | protected Image mImage = null;
92 |
93 | /*******************************************/
94 | /* setter / getter */
95 | /*******************************************/
96 | public RectTransform GetRectTransfom() { return this.mRectTransform; }
97 | public Button ButtonComp { get { return this.mButton; } }
98 | public Image Image { get { return this.mImage; } }
99 | public int DialogueIndex { get { return this.mDialogueIndex; } set { this.mDialogueIndex = value; } }
100 | public bool AutoListener { get { return this.mAutoListener; } set { this.mAutoListener = value; } }
101 | public bool Interactable {
102 | get { return this.mInteractable; }
103 | set
104 | {
105 | mInteractable = value;
106 |
107 | // set this, in order to get the effect immdediatly.
108 | SetInteractable();
109 | }
110 | }
111 | public Text ButtonText { get { return this.mButtonText; } }
112 | /* Compatible with 1.5.3 version of JCSUnity */
113 | public void SetCallback(CallBackFunc func) { this.btnCallBack += func; }
114 | public void SetCallback(CallBackFuncBtn func) { this.btnCallBackBtn += func; }
115 | public void SetSystemCallback(CallBackFunc func) { this.btnSystemCallBack += func; }
116 | public void SetSystemCallback(CallBackFuncBtn func) { this.btnSystemCallBackBtn += func; }
117 | public void SetSystemCallback(CallBackFuncBtnInt func, int selection)
118 | {
119 | this.btnSystemCallBackBtnInt += func;
120 | this.mDialogueSelection = selection;
121 | }
122 |
123 | public int DialogueSelection { get { return this.mDialogueSelection; } }
124 |
125 | /*******************************************/
126 | /* Unity's function */
127 | /*******************************************/
128 | protected virtual void Awake()
129 | {
130 | InitJCSButton();
131 | }
132 |
133 | /*******************************************/
134 | /* Self-Define */
135 | /*******************************************/
136 | //----------------------
137 | // Public Functions
138 |
139 | ///
140 | /// Intialize jcs button once.
141 | ///
142 | public void InitJCSButton(bool forceInit = false)
143 | {
144 | if (!forceInit)
145 | {
146 | if (this.mInitialized)
147 | return;
148 | }
149 |
150 | this.mRectTransform = this.GetComponent();
151 | this.mButton = this.GetComponent