Exemple #1
0
    public static void Main(string[] args)
    {
        do
        {
            Console.WriteLine("请输入英雄的名字:");
            string name = Console.ReadLine();
            Console.WriteLine("请输入英雄的种类:");
            string kind = Console.ReadLine();
            Console.WriteLine("请输入英雄的hp:");
            int hp = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("请输入英雄的mp:");
            int  mp   = Convert.ToInt32(Console.ReadLine());
            Hero hero = new Hero();

            hero.name = name;
            hero.kind = kind;
            hero.hp   = hp;
            hero.mp   = mp;

            //获取英雄管理器
            HeroManager manager = HeroManager.manager;
            bool        result  = manager.AddHero(hero);
            if (result)
            {
                Console.WriteLine("添加成功");
            }
            else
            {
                Console.WriteLine("添加失败,容量已满");
            }
        } while (true);
    }
Exemple #2
0
    /// <summary> 영웅 인벤토리 정보 받아오기 </summary>
    public static IEnumerator Init()
    {
        WWWForm form = new WWWForm();

        form.AddField("userID", PlayerPrefs.GetString("userID"));
        form.AddField("type", 1);
        string php = "Hero.php";

        string result = "";

        yield return(Instance.StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x)));

        if (string.IsNullOrEmpty(result))
        {
            yield break;
        }

        JsonData serverJsonData = Instance.ParseCheckDodge(result);

        Instance.AddHero(serverJsonData);

        isInitialized = true;
    }
Exemple #3
0
 public void ApplyReward(HeroInstance hero)
 {
     HeroManager.AddHero(Hero, hero.Faction);
 }
 public override string Execute()
 {
     return(manager.AddHero(list));
 }