예제 #1
0
 public void startFastFight()
 {
     fastFight = true;
     while (!PartiesSingleton.hasWinner() || nextEventTime < 10)
     {
         EventQueueSingleton.queue.startEvent(nextEventTime);
     }
 }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        base.Update();

        if (isActive)
        {
            if (PartiesSingleton.hasWinner())
            {
                CSVLogger.log(EventQueueSingleton.queue.nextEventTime, "FightController", "FightController", "Result");
                foreach (var hero in PartiesSingleton.heroes.getLivePersons())
                {
                    CSVLogger.log(EventQueueSingleton.queue.nextEventTime, "FightController", "FightController", hero.name + "has " + hero.health);
                }

                foreach (var hero in PartiesSingleton.enemies.getLivePersons())
                {
                    CSVLogger.log(EventQueueSingleton.queue.nextEventTime, "FightController", "FightController", hero.name + "has " + hero.health);
                }
                isFinished = true;

                openFightResult();
            }
            else
            {
                if (!EventQueueSingleton.queue.fastFight)
                {
                    string result = EventQueueSingleton.queue.startEvent(Time.fixedTime);
                    if (result.Length > 0)
                    {
                        eventLog.GetComponent <Text>().text = result;
                        displayEvents(EventQueueSingleton.queue.events);
                    }
                }
            }
        }
    }