public void InitData(Transform _map) { ToolRandom.srand((ulong)BattleData.Instance.randSeed); roleManage = gameObject.AddComponent <RoleManage> (); obstacleManage = gameObject.AddComponent <ObstacleManage> (); bulletManage = gameObject.AddComponent <BulletManage> (); GameVector2[] roleGrid; roleManage.InitData(_map.Find("Role"), out roleGrid); obstacleManage.InitData(_map.Find("Obstacle"), roleGrid); bulletManage.InitData(_map.Find("Bullet")); }
// void Start () { // // } public void InitData(Transform _roleParent, out GameVector2[] roleGrid) { initFinish = false; roleParent = _roleParent; dic_role = new Dictionary <int, RoleBase> (); pre_roleBase = Resources.Load <GameObject> ("BattleScene/Role/RoleBase"); pre_roleUI = Resources.Load <GameObject> ("BattleScene/Role/RoleUI"); int _roleNum = BattleData.Instance.list_battleUser.Count; roleGrid = new GameVector2[_roleNum]; for (int i = 0; i < roleGrid.Length; i++) { roleGrid [i] = BattleData.Instance.GetMapGridFromRand(ToolRandom.rand_10000()); } StartCoroutine(CreatRole(roleGrid)); }