Ejemplo n.º 1
0
    public static void RemoveOrganProcess(Organ organ)
    {
        //disconnect
        BodyPart organParent = organ.connectedBodyParts[0];

        organ.SeverAllConnections();
        try
        {
            if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "SampleScene")
            {
                GameObject.FindObjectOfType <BodyPartSelectorManager>().ResetSelectors(organParent);
                GameObject.FindObjectOfType <EmbeddedObjectSelectorManager>().ResetSelectors();
                MonoBehaviour.FindObjectOfType <BodyPartStatusManager>().UpdateStatusCollection();
            }
        }
        catch (System.Exception e)
        {
            Debug.LogError(e);
        }

        UpdateAllBodyPartHeartConnections();

        //remove from being child of bodypart
        organ.transform.SetParent(organ.transform.parent.parent);

        MonoBehaviour.FindObjectOfType <ActionTracker>().surgery_organremovals += 1;
    }