public GameObject CreateFightHero(Hero hero) { GameObject AI = null; string body_prefab_name = DataManager.instance.GetConfigValueToString(hero.heroJob.ToString() + "_body" + "_" + hero.heroSex.ToString()); GameObject bodyPrefab = DataManager.GetInstance().CreateGameObjectFromAssetsBundle("enemy", body_prefab_name); if (bodyPrefab != null) { Enity enity = bodyPrefab.GetComponent <Enity>(); if (enity != null) { enity.InitEnityByHero(hero); } AI = DataManager.GetInstance().CreateGameObjectFromAssetsBundle("", "AI"); bodyPrefab.transform.SetParent(AI.transform, false); AIBase AIScript = AI.GetComponent <AIBase>(); AIScript.InitAIBaseByEnity(enity); AI.name = hero.id.ToString(); createEnityIndex++; } return(AI); }