Beispiel #1
0
 // Use this for initialization
 void Start()
 {
     instance  = this;
     newScaleX = GetComponent <Transform>().localScale.x * 2 / 3;
     newScaleY = GetComponent <Transform>().localScale.y * 2 / 3;
     GetComponent <Transform>().localScale = new Vector3(newScaleX, newScaleY, GetComponent <Transform>().localScale.z);
 }
Beispiel #2
0
    public void AddStatus(BodyPart bodyPart)
    {
        GameObject     statusGameObject = Instantiate(statusPrefab, statusPanel.transform);
        BodyPartStatus status           = statusGameObject.GetComponent <BodyPartStatus>();

        status.name = bodyPart.name;

        if (bodyPart is Organ)
        {
            status.partName.text = "  " + bodyPart.name;
        }
        else
        {
            status.partName.text = bodyPart.name;
        }

        BloodBar  bloodBar  = status.bloodBar;
        OxygenBar oxygenBar = status.oxygenBar;
        HealthBar healthBar = status.healthBar;

        bloodBar.bodyPart = bodyPart;
        bloodBar.MinMax();
        oxygenBar.bodyPart = bodyPart;
        oxygenBar.MinMax();
        healthBar.bodyPart = bodyPart;
        healthBar.MinMax();
    }
Beispiel #3
0
    private openFlap flap;                      //!< to hold a reference to the flap script on the flaps

    /**
     * Use this for initialization
     */
    void Start()
    {
        // find the oxygen bar
        oxygen = GameObject.Find("MouthGUI").GetComponent <OxygenBar>();

        // get the script "openFlap" on the flaps
        flap = transform.parent.gameObject.GetComponent <openFlap>();
    }
Beispiel #4
0
    private void Start()
    {
        rb         = GetComponent <Rigidbody2D>();
        anim       = GetComponent <Animator>();
        coll       = GetComponent <Collider2D>();
        oxygenTank = GetComponent <GameObject>();


        PermanenttUI.perm.healthAmount.text = PermanenttUI.perm.health.ToString();
        oxygenBar = GameObject.Find("oxygenBar").GetComponent <OxygenBar>();
    }
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         Init(100f);
     }
     else
     {
         //Destroy(this);
     }
 }
Beispiel #6
0
    private void Awake()
    {
        if (!instance)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        Transform oxygenContainer = transform.Find("OxygenFull");

        conditionText        = oxygenContainer.GetComponentInChildren <Text>();
        conditionTextOutline = oxygenContainer.GetComponentInChildren <Outline>();
        oxygenIndicator      = oxygenContainer.GetComponent <Image>();
        oxygenBackground     = transform.Find("OxygenOut").GetComponent <Image>();
        ultraCriticalOutline = transform.Find("UltraCriticalOutline").GetComponent <Image>();
        ultraCriticalOutline.canvasRenderer.SetAlpha(0.0f);
        ultraCriticalOutline.gameObject.SetActive(false);
    }
Beispiel #7
0
 // Start is called before the first frame update
 void Start()
 {
     oxygenBar = GameObject.Find("oxygenBar").GetComponent <OxygenBar>();
 }
 private void OnDestroy()
 {
     Debug.Log("DestroyedGameBar");
     instance = null;
 }
Beispiel #9
0
 void Start()
 {
     player         = GameObject.Find("Player").GetComponent <PlayerController>();
     oxygenBar      = GameObject.Find("OxygenBar").GetComponent <OxygenBar>();
     positionOffset = transform.position;
 }
Beispiel #10
0
    OxygenBar oxygenBar;                        //!< to hold a reference to the oxygen bar

    /**
     * Use this for initialization
     */
    void Start()
    {
        oxygenBar = gameObject.GetComponent <OxygenBar> ();             // find the reference to the oxygen bar
    }
Beispiel #11
0
 void Awake()
 {
     Instance = this;
 }
Beispiel #12
0
 void Awake()
 {
     Instance = this;
 }