Esempio n. 1
0
    static int DOValue(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 3)
            {
                UnityEngine.UI.Slider obj = (UnityEngine.UI.Slider)ToLua.CheckObject <UnityEngine.UI.Slider>(L, 1);
                float arg0            = (float)LuaDLL.luaL_checknumber(L, 2);
                float arg1            = (float)LuaDLL.luaL_checknumber(L, 3);
                DG.Tweening.Tweener o = obj.DOValue(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 4)
            {
                UnityEngine.UI.Slider obj = (UnityEngine.UI.Slider)ToLua.CheckObject <UnityEngine.UI.Slider>(L, 1);
                float arg0            = (float)LuaDLL.luaL_checknumber(L, 2);
                float arg1            = (float)LuaDLL.luaL_checknumber(L, 3);
                bool  arg2            = LuaDLL.luaL_checkboolean(L, 4);
                DG.Tweening.Tweener o = obj.DOValue(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.UI.Slider.DOValue"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Esempio n. 2
0
 public void TakeEnergy(int amount, bool fromCosmicEnergy = false)
 {
     if (_isDead)
     {
         return;
     }
     _currentEnergy += amount;
     if (_currentEnergy <= 0)
     {
         GameThreadManager.Instance.uiHudManadger.userMsg.text = fromCosmicEnergy ? "Base  without energy" : "Don't forget protect base";
         GameThreadManager.Instance.uiHudManadger.userMsg.DOFade(2f, 1f);
         OnDeath();
     }
     else
     {
         if (_currentEnergy >= 10)
         {
             GameThreadManager.Instance.uiHudManadger.userMsg.text = "You win, to be continued...";
             GameThreadManager.Instance.uiHudManadger.userMsg.DOFade(2f, 1f);
             Camera.main.DOOrthoSize(100f, 15f);
         }
     }
     energySlider.DOValue(_currentEnergy * 10f, 0.5f);
 }