Пример #1
0
    public override void OnShow()
    {
        base.OnShow();

        AudioManager.instance.PlayBGM(ConstConfig.WndFightBg);
        UpdateSpeedText();

        AddEvent();

        fightManager.BeginFight(playerModel.fightRoles, aiModel.fightRoles, playerRoleGos, aiRoleGos);

        RolesToFightPos();

        TimeManager.Regist((id) =>
        {
            fightManager.StartFight();
        }, 1.2f, 0, 1);


        for (int i = 0; i < 9; i++)
        {
            RoleBase pRole = playerModel.fightRoles[i];
            RoleBase aRole = aiModel.fightRoles[i];

            UIListener.GetUIListener(playerRoleGos[i]).param = pRole;

            UIListener.GetUIListener(aiRoleGos[i]).param = aRole;
        }
    }
Пример #2
0
    private void StartFightingWith(Character other)
    {
        var fightTime = xpMap.GetFightLength(this.level, other.level);
        var fight     = FightManager.StartFight(new Character[] { this, other }, fightTime);

        battleAudio.loop = true;
        battleAudio.Play();

        fightMeter.FightToWatch = fight.Value;
        fightMeter.gameObject.SetActive(true);
    }
Пример #3
0
 static int StartFight(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         FightManager obj  = (FightManager)ToLua.CheckObject(L, 1, typeof(FightManager));
         int          arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         MapManager.MapDataParamsPacker arg1 = (MapManager.MapDataParamsPacker)ToLua.CheckObject(L, 3, typeof(MapManager.MapDataParamsPacker));
         bool arg2 = LuaDLL.luaL_checkboolean(L, 4);
         obj.StartFight(arg0, arg1, arg2);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }