Exemplo n.º 1
0
        public static void AnimatedShowHide_Cockpit(HUDStandardItem hudItem, Cockpit cockpit, float fShowDuration = 3.0f, float fFadeDuration = 0.25f)
        {
            AnimatedShowHideHUDItem anim = hudItem.RootGameObject.AddComponent <AnimatedShowHideHUDItem>();

            anim.CompleteCallback += () => {
                anim.HUDItem.ClearGameObjects(false);
                cockpit.RemoveUIElement(anim.HUDItem, true);
            };
            anim.Play(hudItem, fShowDuration, fFadeDuration);
        }
Exemplo n.º 2
0
        public void Dismiss()
        {
            List <SceneUIElement> vIcons = new List <SceneUIElement>(IconCollection.Children);

            activeCockpit.RemoveUIElement(IconCollection, false);
            IconCollection.RemoveAllChildren();
            GameObject.Destroy(IconCollection.RootGameObject);

            foreach (HUDButton button in vIcons)
            {
                FolderIconRemover remove = button.RootGameObject.AddComponent <FolderIconRemover>();
                remove.Begin(button);
            }
        }
Exemplo n.º 3
0
        public static void AnimatedDimiss_Cockpit(HUDStandardItem hudItem, Cockpit cockpit, bool bDestroy, float fDuration = 0.25f)
        {
            AnimatedDismissHUDItem anim = hudItem.RootGameObject.AddComponent <AnimatedDismissHUDItem>();

            anim.CompleteCallback += () => {
                if (bDestroy)
                {
                    anim.HUDItem.ClearGameObjects(false);       // what is this line for??
                }
                cockpit.RemoveUIElement(anim.HUDItem, bDestroy);
                if (bDestroy == false)
                {
                    anim.HUDItem.IsVisible = false;
                }
            };
            anim.Play(hudItem, fDuration);
        }