├── .gitignore ├── Assets ├── Resources.meta ├── Resources │ ├── BillingMode.json │ └── BillingMode.json.meta ├── Scenes.meta ├── Scenes │ ├── ToggleDemo.unity │ └── ToggleDemo.unity.meta ├── Scripts.meta ├── Scripts │ ├── JCSUnity.meta │ ├── JCSUnity │ │ ├── Enum.meta │ │ ├── Enum │ │ │ ├── JCS_TransformType.cs │ │ │ ├── JCS_TransformType.cs.meta │ │ │ ├── JCS_TweenType.cs │ │ │ ├── JCS_TweenType.cs.meta │ │ │ ├── JCS_UnityObjectType.cs │ │ │ └── JCS_UnityObjectType.cs.meta │ │ ├── JCS_Button.cs │ │ ├── JCS_Button.cs.meta │ │ ├── JCS_ColorTweener.cs │ │ ├── JCS_ColorTweener.cs.meta │ │ ├── JCS_TransformTweener.cs │ │ ├── JCS_TransformTweener.cs.meta │ │ ├── JCS_UnityObject.cs │ │ ├── JCS_UnityObject.cs.meta │ │ ├── JCS_Utility.cs │ │ └── JCS_Utility.cs.meta │ ├── JCS_Toggle.cs │ ├── JCS_Toggle.cs.meta │ ├── JCS_ToggleSign.cs │ ├── JCS_ToggleSign.cs.meta │ ├── Lib.meta │ └── Lib │ │ ├── Easing.cs │ │ ├── Easing.cs.meta │ │ ├── Tweener.cs │ │ └── Tweener.cs.meta ├── Sprites.meta └── Sprites │ ├── toggle_bg.png │ ├── toggle_bg.png.meta │ ├── toggle_btn.png │ └── toggle_btn.png.meta ├── LICENSE ├── Logs ├── AssetImportWorker0.log ├── Packages-Update.log ├── shadercompiler-AssetImportWorker0.log ├── shadercompiler-UnityShaderCompiler.exe0.log ├── shadercompiler-UnityShaderCompiler.exe1.log ├── shadercompiler-UnityShaderCompiler.exe2.log └── shadercompiler-UnityShaderCompiler.exe3.log ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset └── VersionControlSettings.asset ├── README.md ├── UserSettings ├── EditorUserSettings.asset └── Search.settings ├── psd └── toggle-on.psd └── screenshot └── toggle_demo.gif /.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 | -------------------------------------------------------------------------------- /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: -------------------------------------------------------------------------------- 1 | {"androidStore":"GooglePlay"} -------------------------------------------------------------------------------- /Assets/Resources/BillingMode.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01e44eda5dc74de439d4e23ab523dc37 3 | TextScriptImporter: 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/Scenes/ToggleDemo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 748c2bcaf07910b4784b23043cae3233 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c50b21a78864de242a0cea38fbe01f85 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /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/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_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 | -------------------------------------------------------------------------------- /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