// Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Z))
        {
            health.CurrentVal -= 10;
        }
        if (Input.GetKeyDown(KeyCode.X))
        {
            health.CurrentVal += 10;
        }
        GameObject flaregun  = GameObject.Find("flaregun");
        flaregun   gunscript = flaregun.GetComponent <flaregun>();

        ammo.CurrentVal = gunscript.currentRound;
        if (Input.GetKeyDown(KeyCode.B))
        {
            ammo.CurrentVal -= 1;
        }
        if (Input.GetKeyDown(KeyCode.R))
        {
            ammo.CurrentVal = 5;
        }
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            water.color     = new Color(0.392f, 0.392f, 0.392f, 1);
            fire.color      = new Color(1, 1, 1, 1);
            earth.color     = new Color(0.392f, 0.392f, 0.392f, 1);
            ammo.CurrentVal = 5;
        }
        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            water.color     = new Color(1, 1, 1, 1);
            fire.color      = new Color(0.392f, 0.392f, 0.392f, 1);
            earth.color     = new Color(0.392f, 0.392f, 0.392f, 1);
            ammo.CurrentVal = 5;
        }
        if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            water.color     = new Color(0.392f, 0.392f, 0.392f, 1);
            fire.color      = new Color(0.392f, 0.392f, 0.392f, 1);
            earth.color     = new Color(1, 1, 1, 1);
            ammo.CurrentVal = 5;
        }
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     flaregun = GameObject.Find("flaregun");
     flare = flaregun.GetComponent<flaregun>();
 }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     flaregun = GameObject.Find("flaregun");
     flare    = flaregun.GetComponent <flaregun>();
 }