Esempio n. 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);
 }
Esempio n. 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();
    }
Esempio n. 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>();
    }
Esempio n. 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);
     }
 }
Esempio n. 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);
    }
Esempio n. 7
0
File: lava.cs Progetto: bensb1/FMP
 // Start is called before the first frame update
 void Start()
 {
     oxygenBar = GameObject.Find("oxygenBar").GetComponent <OxygenBar>();
 }
 private void OnDestroy()
 {
     Debug.Log("DestroyedGameBar");
     instance = null;
 }
Esempio n. 9
0
 void Start()
 {
     player         = GameObject.Find("Player").GetComponent <PlayerController>();
     oxygenBar      = GameObject.Find("OxygenBar").GetComponent <OxygenBar>();
     positionOffset = transform.position;
 }
Esempio n. 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
    }
Esempio n. 11
0
 void Awake()
 {
     Instance = this;
 }
Esempio n. 12
0
 void Awake()
 {
     Instance = this;
 }