Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (engineMng == null)
     {
         return;
     }
     if (isPointerOver)
     {
         if (Input.GetMouseButtonDown(0))
         {
             engineMng.AddPowerOnEngine(Engine.engineType.repair, 1);
         }
         if (Input.GetMouseButtonDown(1))
         {
             engineMng.RmvPowerOnEngine(Engine.engineType.repair, 1);
         }
         if (Input.GetMouseButtonDown(3) || Input.GetKeyDown(KeyCode.O))
         {
             engineMng.GetEngine(Engine.engineType.repair).LevelUp();
         }
     }
     if (engineMng.GetEngine(Engine.engineType.repair).operated)
     {
         currentPowerBar.GetComponent <Image>().color = Color.blue;
     }
     else
     {
         currentPowerBar.GetComponent <Image>().color = greyColor;
     }
     maxPowerBar.GetComponent <Image>().fillAmount       = engineMng.GetEngine(Engine.engineType.repair).maxPwr / 10f;
     currentPowerBar.GetComponent <Image>().fillAmount   = engineMng.GetEngine(Engine.engineType.repair).currentPwr / 10f;
     currentPowerBarFG.GetComponent <Image>().fillAmount = engineMng.GetEngine(Engine.engineType.repair).currentPwr / 10f;
     levelPowerBar.GetComponent <Image>().fillAmount     = engineMng.GetEngine(Engine.engineType.repair).level / 10f;
     levelPowerBarFG.GetComponent <Image>().fillAmount   = engineMng.GetEngine(Engine.engineType.repair).level / 10f;
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (engineMng == null)
        {
            return;
        }
        if (isPointerOver)
        {
            if (Input.GetMouseButtonDown(0))
            {
                engineMng.AddPowerOnEngine(Engine.engineType.power, 1);
            }
            if (Input.GetMouseButtonDown(1))
            {
                engineMng.RmvPowerOnEngine(Engine.engineType.power, 1);
            }

            if (Input.GetMouseButtonDown(3) || Input.GetKeyDown(KeyCode.O))
            {
                engineMng.GetEngine(Engine.engineType.power).LevelUp();
            }
        }


        maxPowerBar.GetComponent <Image>().fillAmount       = engineMng.GetEngine(Engine.engineType.power).maxPwr / 10f;
        currentPowerBar.GetComponent <Image>().fillAmount   = engineMng.GetEngine(Engine.engineType.power).currentPwr / 10f;
        currentPowerBarFG.GetComponent <Image>().fillAmount = engineMng.GetEngine(Engine.engineType.power).currentPwr / 10f;
    }