// Start is called before the first frame update
 void Start()
 {
     bodyPartManager = FindObjectOfType <BodyPartManager>();
     unlockTracker   = FindObjectOfType <UnlockTracker>();
     PopulateBodyPartsList();
     PopulateOrgansList();
 }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     bodyPartManager = FindObjectOfType <BodyPartManager>();
     clock           = FindObjectOfType <Clock>();
     timeElapsed     = 0.0f;
     expiryTime      = 60.0f * 30.0f;
 }
Exemplo n.º 3
0
    public void GenerateInjuries()
    {
        textLog          = FindObjectOfType <TextLog>();
        bodyPartManager  = FindObjectOfType <BodyPartManager>();
        unlockTracker    = FindObjectOfType <UnlockTracker>();
        gameSetupTracker = FindObjectOfType <GameSetupScenarioTracker>();

        EasyInjuries(gameSetupTracker.easyInjuries);
        MediumInjuries(gameSetupTracker.mediumInjuries);
        HardInjuries(gameSetupTracker.hardInjuries);
        randomIndex = 0;
        randomNumbersReturned.Add(77777);

        try
        {
            if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "SampleScene")
            {
                GameObject.FindObjectOfType <BodyPartSelectorManager>().ResetSelectors();
                GameObject.FindObjectOfType <EmbeddedObjectSelectorManager>().ResetSelectors();
            }
        }
        catch (System.Exception e)
        {
            Debug.LogError($"PhysicalInjuryGenertor: Error resetting selectors: {e}");
        }
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     penguin         = GetComponent <Penguin>();
     bodyPartManager = GameObject.FindGameObjectWithTag("BodyPartManager").GetComponent <BodyPartManager>();
     agent           = GetComponent <NavMeshAgent>();
     heightManager   = GetComponent <HeightManager>();
 }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     bodyPartManager = GameObject.FindGameObjectWithTag("BodyPartManager").GetComponent <BodyPartManager>();
     anim            = GetComponent <Animator>();
     penguin         = GetComponentInParent <Penguin>();
     navManager      = GetComponentInParent <NavManager>();
     heightManager   = GetComponentInParent <HeightManager>();
 }
Exemplo n.º 6
0
    private void Awake()
    {
        manager = GetComponentInParent <BodyPartManager>();

        if (manager == null)
        {
            Debug.Log(transform.root.name + " has a bodypart but not BodyPartManager. Disabling BodyPart...");
            this.enabled = false;
        }
    }
Exemplo n.º 7
0
    // Start is called before the first frame update
    void Start()
    {
        if (!manuallyDisabled)
        {
            deathMonitor    = FindObjectOfType <DeathMonitor>();
            lifeMonitor     = FindObjectOfType <LifeMonitor>();
            bodyPartManager = FindObjectOfType <BodyPartManager>();

            //Time.timeScale = globalTimeScalingFactor;
            isTimePassing    = false;
            currentTime.text = "00:00:00";
            clockTarget      = 0.0f;
            timeElapsed      = 0.0f;
        }
    }
Exemplo n.º 8
0
    public bool SafeToDischarge()
    {
        BodyPartManager bodyPartManager = FindObjectOfType <BodyPartManager>();
        bool            safe            = true;

        //check there's an appropriate number of each organ and limb
        if (BodyPartCountCheck())
        {
            safe = false;
        }

        //currently, all charms are set to expire after 30 minutes anyway, but best to check just in case:
        if (CharmCheck())
        {
            safe = false;
        }

        if (EmbeddedObjectCheck())
        {
            safe = false;
        }

        return(safe);
    }
Exemplo n.º 9
0
 public void Start()
 {
     bodyPartManager = FindObjectOfType <BodyPartManager>();
     UpdateHeartConnections();
 }
Exemplo n.º 10
0
 private void Awake()
 {
     Instance = this;
 }
Exemplo n.º 11
0
 // Start is called before the first frame update
 void Awake()
 {
     bodyPartManager = FindObjectOfType <BodyPartManager>();
 }
Exemplo n.º 12
0
 // Start is called before the first frame update
 void Start()
 {
     hasPlayerWon    = false;
     bodyPartManager = FindObjectOfType <BodyPartManager>();
 }
Exemplo n.º 13
0
 // Use this for initialization
 void Start()
 {
     penguin         = GetComponent <Penguin>();
     bodyPartManager = GameObject.FindGameObjectWithTag("BodyPartManager").GetComponent <BodyPartManager>();
     navManager      = GetComponent <NavManager>();
 }
 // Start is called before the first frame update
 void Awake()
 {
     buttonActions   = FindObjectOfType <ButtonActions>();
     bodyPartManager = FindObjectOfType <BodyPartManager>();
 }
Exemplo n.º 15
0
    public static void DeleteBodyPartProcess(BodyPart bodyPart)
    {
        //destroy all organs contained in the bodypart
        foreach (Organ organ in bodyPart.containedOrgans)
        {
            try
            {
                GameObject.FindObjectOfType <BodyPartManager>().bodyParts.Remove(organ);
                if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "SampleScene")
                {
                    GameObject.FindObjectOfType <BodyPartStatusManager>().RemoveStatus(organ);
                }
            }
            catch (System.Exception e)
            {
                Debug.LogError(e);
            }

            GameObject.Destroy(organ.gameObject);
        }

        //destroy all objects embedded in the bodypart
        foreach (EmbeddedObject embeddedObject in bodyPart.embeddedObjects)
        {
            GameObject.Destroy(embeddedObject.gameObject);
        }

        //remove bodypart from tracking
        try
        {
            bodyPart.SeverAllConnections();
            GameObject.FindObjectOfType <BodyPartManager>().bodyParts.Remove(bodyPart);
            if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "SampleScene")
            {
                GameObject.FindObjectOfType <BodyPartStatusManager>().RemoveStatus(bodyPart);
            }
        }
        catch (System.Exception e)
        {
            Debug.LogError(e);
        }

        if (bodyPart is Organ)
        {
            BodyPartManager x = GameObject.FindObjectOfType <BodyPartManager>();
            GameObject.FindObjectOfType <BodyPartManager>().organs.Remove((Organ)bodyPart);
        }

        GameObject.Destroy(bodyPart.gameObject);
        try
        {
            if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "SampleScene")
            {
                GameObject.FindObjectOfType <BodyPartSelectorManager>().ResetSelectors();
                GameObject.FindObjectOfType <EmbeddedObjectSelectorManager>().ResetSelectors();
            }
        }
        catch (System.Exception e)
        {
            Debug.LogError(e);
        }

        UpdateAllBodyPartHeartConnections();

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