public void SpawnSheeps(int i) { var SheepData = Data.SheepData; GameObject instance = GameObject.Instantiate(SheepData.Prefab, new Vector3(i, 1, i), Quaternion.identity); SheepModel Sheep = new SheepModel(instance, SheepData); _context.SheepModels.Add(i, Sheep); }
public IEnumerator updateModel(SheepModel Model, int Time) { yield return(new WaitForSeconds(Time)); if (Model.Sheep != null) { Model.SheepAgent.nextPosition = Model.GetPosition().position; Model.SheepAgent.updatePosition = true; Model.IsPatrol = true; } }
public void StartC(SheepModel Model, int Time) { StartCoroutine(updateModel(Model, Time)); }