Пример #1
0
        static void Duplicate_ContextMenu(MenuCommand command)
        {
            AnimatorController animator = Selection.activeObject as AnimatorController;

            DuplicateAnimatorPopup.Show(animator.name, delegate(string replaceFrom, string replaceTo)
            {
                Duplicate(animator, replaceFrom, replaceTo);
            });
        }
        public static void Show(string animatorName, Action <string, string> callbackAccept)
        {
            DuplicateAnimatorPopup window = CreateInstance <DuplicateAnimatorPopup>();

            window._callbackAccept   = callbackAccept;
            window._animatorName     = animatorName;
            window.position          = new Rect(Screen.width / 2, Screen.height / 2, 300, 200);
            window.titleContent.text = "Duplicate '" + animatorName + "'";
            window.ShowUtility();
        }