public static void CreateMyUGUIButtonColorTint() { GameObject go = MyUGUIButton.CreateTextTemplate(); MyUGUIButton button = go.GetComponent <MyUGUIButton>(); button.Button.transition = Selectable.Transition.ColorTint; Debug.Log("[MyClasses] Text Button (Color Tint) was created."); }
public static void CreateMyUGUIButtonScaleAnimation() { GameObject go = MyUGUIButton.CreateTextTemplate(); MyUGUIButton button = go.GetComponent <MyUGUIButton>(); button.Button.transition = Selectable.Transition.Animation; Animator animator = go.AddComponent <Animator>(); string[] paths = new string[] { "Assets/MyClasses", "Assets/Core/MyClasses", "Assets/Plugin/MyClasses", "Assets/Plugins/MyClasses", "Assets/Framework/MyClasses", "Assets/Frameworks/MyClasses" }; for (int i = 0; i < paths.Length; i++) { if (System.IO.File.Exists(paths[i] + "/Sources/Animations/my_animator_button_click_scale.controller")) { animator.runtimeAnimatorController = (RuntimeAnimatorController)UnityEditor.AssetDatabase.LoadAssetAtPath(paths[i] + "/Sources/Animations/my_animator_button_click_scale.controller", typeof(RuntimeAnimatorController)); break; } } Debug.Log("[MyClasses] Text Button (Scale Animation) was created."); }