Ejemplo n.º 1
0
    private void Start()
    {
        resource = this.GetComponent <scr_Resource>();

        button.onClick.AddListener(OnClick);

        maxVal = 100.0f;
        resource.setResourceScale(maxVal);
        resource.setRescourceValue(25.0f);
        resource.setDelay(2.5f);

        // Get the speed of the needle based of 180 degrees over the time/scale of the pressure bar
        speed = 180 / resource.getResourceScale();
    }
Ejemplo n.º 2
0
    private void Start()
    {
        // Find resource class refenece
        resource     = this.GetComponent <scr_Resource>();
        healthBar[0] = GameObject.Find("Health1").GetComponent <Image>();
        healthBar[1] = GameObject.Find("Health2").GetComponent <Image>();
        healthBar[2] = GameObject.Find("Health3").GetComponent <Image>();

        button.onClick.AddListener(OnClick);

        //Testing values
        resource.setResourceScale(100.0f);
        resource.setDecayModifier(5.0f);
        resource.setRescourceValue(16.6f);
        resource.setDelay(5.0f);

        percentage = resource.getResourceScale() / (healthBar.Length * 2);
    }