// Deactivate this site element to clean it up. public Coroutine Deactivate() { // Start a coroutine to deactivate the object. Coroutine deactivateCoroutine = StartCoroutine(DeactivateCoroutine()); // If this is the active site elmeent, mark the active site element as null. if (SiteManager.activeSiteElement == this) { SiteManager.activeSiteElement = null; } // Set active to false active = false; //Reset idle animation idleAnimation.Reset(); //Hide the element-specific UI if (elementUI != null) { elementUI.Cleanup(); } DeactivateCustomData(); // Return the deactivation coroutine. return(deactivateCoroutine); }