//SheepController SpawnSheep() //{ // SheepController sheep = sheepControllersPool[currentSheepPoolCursor]; // SheepConfigData sheepConfigData = ConfigManager.Instance.GetSheepConfigByType(1); // sheep.InitSheep(sheepConfigData.Sheepvalue, sheepConfigData.Speed); // currentSheepPoolCursor++; // if (currentSheepPoolCursor >= numOfSheep) // currentSheepPoolCursor = 0; // float x = UnityEngine.Random.Range(spawningBox.bounds.center.x - spawningBox.bounds.extents.x, spawningBox.bounds.center.x + spawningBox.bounds.extents.x); // float z = UnityEngine.Random.Range(spawningBox.bounds.center.z - spawningBox.bounds.extents.z, spawningBox.bounds.center.z + spawningBox.bounds.extents.z); // sheep.transform.position = new Vector3(x, 1.8f, z); // sheep.transform.localEulerAngles = new Vector3(0, UnityEngine.Random.Range(0,360), 0); // sheep.gameObject.SetActive(true); // activeSheeps.Add(sheep); // return sheep; //} public void PutSheepBackToCage(SheepController sheepController) { float x = UnityEngine.Random.Range(spawningBox.bounds.center.x - spawningBox.bounds.extents.x, spawningBox.bounds.center.x + spawningBox.bounds.extents.x); float z = UnityEngine.Random.Range(spawningBox.bounds.center.z - spawningBox.bounds.extents.z, spawningBox.bounds.center.z + spawningBox.bounds.extents.z); sheepController.transform.position = new Vector3(x, 1.8f, z); sheepController.ResetState(); if (!activeSheeps.Contains(sheepController)) { activeSheeps.Add(sheepController); } currentSheepInCage++; LevelConfigData lvlConfig = ConfigManager.Instance.GetLevelConfigByLevel(DataManager.Instance.PlayerData.userLevel); txtLimitSheep.text = currentSheepInCage + "/" + lvlConfig.Maxsheep; }