コード例 #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;
 }
コード例 #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;
    }
コード例 #3
0
 public void PowerEngine(Engine.engineType _engineType, int _pwrAmount)
 {
     engineMng.AddPowerOnEngine(_engineType, _pwrAmount);
 }