// Start is called before the first frame update
    void Start()
    {
        fuelBar.SetMaxFuel(fuel);
        rigidBody   = GetComponent <Rigidbody>(); //this gives us access to the rigidbody in unity
        audioSource = GetComponent <AudioSource>();

        //panelRectTransform.anchorMin = new Vector2(1, 0);
        //panelRectTransform.anchorMax = new Vector2(0, 1);
        //panelRectTransform.pivot = new Vector2(0.5f, 0.5f);
    }
 public void EnableOrDisableFuelBar(bool enable)
 {
     fuelBarUI.SetActive(enable);
     if (enable)
     {
         //Obtains the fuel atributes
         playerWeaponFuel = player.GetComponentInChildren <Fuel>();
         playerFuelBar    = GetComponentInChildren <FuelBar>();
         playerFuelBar.SetMaxFuel(playerWeaponFuel.GetMaxFuel());
         playerFuelBar.SetCurrentFuel(playerWeaponFuel.GetMaxFuel());
     }
 }
Exemple #3
0
    void Start()
    {
        playerController = GetComponent <PlayerController>();
        playerStates     = PlayerStates.Instance;
        rb = GetComponent <Rigidbody2D>();

        maxFuel = 100f;
        fuel    = maxFuel;
        fuelBar.SetMaxFuel(maxFuel);

        curGrav   = playerController.Gravity;
        curFlyCof = playerController.FallMultiplier;
    }
Exemple #4
0
 // Start is called before the first frame update
 void Start()
 {
     press  = false;
     rb     = GetComponent <Rigidbody2D>();
     fire   = GameObject.FindGameObjectWithTag("fire");
     zValue = cam.orthographicSize;
     fire.SetActive(false);
     rb.gravityScale = 0;
     crashed         = false;
     _touched        = false;
     canPlay         = false;
     fuelBar.SetMaxFuel(fuel);
 }