Example #1
0
    ///<summary>Check battle started and updates units to be set dead in certain condition. also updates number and battle indicator, debug infos</summary>
    public void Academy_Update()
    {
        if (battleStarted)
        {
            knightNumber = 0;
            enemyNumber  = 0;
            GameObject[] Units = inspector.getCurrentUnits();
            foreach (GameObject unit in Units)
            {
                if (inspector.setScriptsFrom(unit) && !inspector.isDead() && inspector.getLives() < 0 && !inspector.isDoneInProgress())
                {
                    inspector.setDead();
                }
            }
            GameObject[] UpdatedUnits = inspector.getCurrentUnits();
            for (int i = 0; i < UpdatedUnits.Length; i++)
            {
                if (inspector.setScriptsFrom(UpdatedUnits[i]) && !inspector.isDead())
                {
                    knightNumber += (inspector.getTag() == "Knight")?1:0;
                    enemyNumber  += (inspector.getTag() == "Enemy")?1:0;
                }
            }
        }

        /*
         * GameObject nowUnit=cam.getStickyUnit();
         * if(inspector.setScriptsFrom(nowUnit)) {
         *      DebugInner.setFromUnit(nowUnit);
         * }
         *
         * infoPanel.text = $@"Id:{inspector.InnerObject.GetInstanceID()}
         * Hp:{DebugInner.initialLives}/{DebugInner.currentLives}
         * Default Damage:{DebugInner.defaultDammage}
         * Attack Tag:{DebugInner.attackTag}
         * Range:{DebugInner.range}
         * Unit Type:{DebugInner.unitType}
         *
         * Total Damage:{DebugInner.totalDamage}
         * Pre Reward:{DebugInner.preReward}
         *
         * Knight Num:{knightNumber}
         * Enemy Num:{enemyNumber}
         * Episode:{AcademyInner.GetEpisodeCount()}
         * ";
         *
         */
    }