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); }
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); } }
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); }