public void ui_ingame_DisplayError(string text)
 {
     e.StopCoroutine("ui_ingame_ErrorDisplay");
     e.StartCoroutine(ui_ingame_ErrorDisplay(text));
 }
        public void combat_attemptCastSkill(BaseSkill s)
        {
            bool validTargetEnemy    = false;
            bool validTargetFriendly = false;
            bool validTargetSelf     = false;

            if (State == COMBAT_STATE.STATE_DEAD)
            {
                e.getUI().ui_ingame_DisplayError("You are dead.");
                return;
            }
            else if (onGlobalCooldown)
            {
                e.getUI().ui_ingame_DisplayError("You can't cast that yet.");
                return;
            }
            else if (s.onCooldown)
            {
                e.getUI().ui_ingame_DisplayError("That skill isn't ready yet.");
                return;
            }
            else if (CombatTarget != null)
            {
                // if(CombatTarget.isNPC)
                // {
                if (CombatTarget.Faction == AI_Faction.Hostile)
                {
                    if (s.allowedTargets.Contains(Skill_Targets.Enemy))
                    {
                        validTargetEnemy = true;
                    }
                    else if (s.allowedTargets.Contains(Skill_Targets.Self))
                    {
                        validTargetSelf = true;
                    }
                    else
                    {
                        e.getUI().ui_ingame_DisplayError("Invalid target.");
                        return;
                    }
                    //Enemy target and non-friendly spell
                }
                else if (CombatTarget.Faction == AI_Faction.Friendly || CombatTarget.Faction == AI_Faction.Neutral)
                {
                    if (s.allowedTargets.Contains(Skill_Targets.Enemy))
                    {
                        e.getUI().ui_ingame_DisplayError("You can't attack that target.");
                        return;
                    }
                    else if (s.allowedTargets.Contains(Skill_Targets.Friendly))
                    {
                        validTargetFriendly = true;
                    }
                    else if (s.allowedTargets.Contains(Skill_Targets.Self))
                    {
                        validTargetSelf = true;
                    }
                    //Enemy target and non-friendly spell
                }
                // }
                // else
                // {
                //     e.getUI().ui_ingame_DisplayError("Invalid target.");
                //     return;
                // }
            }
            else
            {
                e.getUI().ui_ingame_DisplayError("Invalid target.");
                return;
            }

            if (e.getWorld().Player_Self.Energy < s.energyCost)
            {
                e.getUI().ui_ingame_DisplayError("Not enough mana.");
                return;
            }

            if (validTargetFriendly || validTargetEnemy)
            {
                e.StartCoroutine(combat_globalCooldownStart());
                e.getNetwork().net_sendCastSpell(CombatTarget.uniqueID, s.skillID);
                //e.getWorld().world_castSpellFromPlayer();
            }
            else if (validTargetSelf)
            {
                e.StartCoroutine(combat_globalCooldownStart());
                e.getNetwork().net_sendCastSpell(e.getWorld().Player_Self.PlayerID, s.skillID);
            }
            //combat_castSkill(validTargetEnemy, validTargetFriendly, validTargetSelf);
        }
 public void scene_LoadLevel(string level)
 {
     e.StartCoroutine(scene_LoadLevelEnum(level));
 }