Example #1
0
        /// <summary>
        /// Plays the "in" animation of the game object associated with the given transform.
        /// </summary>
        /// <param name="transform">The transform of the game object to animate.</param>
        /// <param name="animateChildren">Whether the children of the given game object must be animated as well.</param>
        public void AnimateIn(Transform transform, bool animateChildren)
        {
            if (transform.gameObject.activeSelf)
            {
                KAnimator uiAnimator = transform.gameObject.GetComponent <KAnimator>();

                if ((uiAnimator != null) && uiAnimator.enabled)
                {
                    uiAnimator.AnimateIn();
                }

                Button button = transform.gameObject.GetComponent <Button>();

                if (button != null)
                {
                    button.interactable = true;
                }

                if (animateChildren)
                {
                    foreach (Transform childTransform in transform)
                    {
                        AnimateIn(childTransform, animateChildren);
                    }
                }
            }
        }
Example #2
0
        public StoreTreeNode(SharedFoldersManager folders, GABHandler gab, GABUser user, string text,
                             Dictionary <BackendId, SharedFolder> currentFolders)
            :
            base(text)
        {
            this._initialShares = currentFolders;
            this._feature       = folders.Feature;
            this._gab           = gab;
            this._user          = user;

            // Create an empty current state. When loading the nodes, the shares will be added. This has the benefit of
            // cleaning up automatically any obsolote shares.
            this._currentShares = new Dictionary <BackendId, SharedFolder>();

            ChildLoader = new UserFolderLoader(this, folders, user);
            ChildLoader.ReloadOnCloseOpen = true;
            HasCheckBox = false;

            // TODO: better icons, better way of handling this
            ImageIndex = user == GABUser.USER_PUBLIC ? 0 : 11;

            // Reloader
            _reloader           = new KAnimator();
            _reloader.Animation = Properties.Resources.TreeLoading;
            _reloader.Visible   = false;
            _reloader.Click    += (s, e) =>
            {
                ChildLoader.Reload();
            };
            Control = _reloader;
        }
Example #3
0
    // Use this for initialization
    void Start()
    {
        SetupScoreLabel();
        KAnimator mainAnimator = mainPanel.GetComponent <KAnimator>();

        mainAnimator.AnimateIn();
    }
Example #4
0
    public void ShowMainPanel()
    {
        KAnimator mainAnimator  = mainPanel.GetComponent <KAnimator>();
        KAnimator aboutAnimator = aboutPanel.GetComponent <KAnimator>();

        mainAnimator.AnimateIn();
        aboutAnimator.AnimateOut();
    }
Example #5
0
    public void ShowAboutPanel()
    {
        aboutPanel.SetActive(true);

        KAnimator mainAnimator  = mainPanel.GetComponent <KAnimator>();
        KAnimator aboutAnimator = aboutPanel.GetComponent <KAnimator>();

        mainAnimator.AnimateOut();
        aboutAnimator.AnimateIn();
    }
Example #6
0
        public StoreTreeNode(SharedFoldersManager folders, GABHandler gab, GABUser user, string sendAsAddress, string text,
                             Dictionary <BackendId, SharedFolder> currentFolders, bool isShared, bool showRemindersWholeStore)
            :
            base(text)
        {
            this._initialShares = currentFolders;
            // Patch in send as address
            foreach (SharedFolder share in _initialShares.Values)
            {
                if (string.IsNullOrWhiteSpace(share.SendAsAddress))
                {
                    share.SendAsAddress = sendAsAddress;
                }
            }
            this._feature       = folders.Feature;
            this._featureSendAs = ThisAddIn.Instance.GetFeature <FeatureSendAs>();
            this._account       = folders.Account;
            this._gab           = gab;
            this._user          = user;
            this._sendAsAddress = sendAsAddress;
            this.IsReadOnly     = false;
            this._isShared      = isShared;

            // Create an empty current state. When loading the nodes, the shares will be added. This has the benefit of
            // cleaning up automatically any obsolote shares.
            this._currentShares = new Dictionary <BackendId, SharedFolder>();

            ChildLoader = new UserFolderLoader(this, folders, user);
            ChildLoader.ReloadOnCloseOpen = true;
            // Can only open the whole store if it's supported and there's an email address, as that's needed to open it
            // However, if it's already opened, we can remove it without the email address
            HasCheckBox = folders.SupportsWholeStore && (!string.IsNullOrWhiteSpace(user.EmailAddress) || isShared);
            ApplyReadOnly(this, IsReadOnly);

            // TODO: better icons, better way of handling this
            ImageIndex = user == GABUser.USER_PUBLIC ? 0 : 11;

            // Reloader
            _reloader           = new KAnimator();
            _reloader.Animation = Properties.Resources.TreeLoading;
            _reloader.Visible   = false;
            _reloader.Click    += (s, e) =>
            {
                ChildLoader.Reload();
            };
            Control = _reloader;

            // Set up sharing
            WantShare            = isShared;
            ShowRemindersInitial = showRemindersWholeStore;
            ShowReminders        = ShowRemindersInitial;
        }
Example #7
0
 void OnEnable()
 {
     animator = (serializedObject.targetObject as KAnimator);
     tex      = EditorGUIUtility.LoadRequired("Kansus Games/K-Animator/K-Animator.png") as Texture2D;
 }