void BoUpdate() { if (boTimer % 64 == 0 && boLoop < 40) { int boType = Random.Range(0, 3); switch (boType) { case 1: bo = new WanderFish(boTemplate_swim); break; case 2: bo = new WanderFish(boTemplate_sway); break; default: bo = new WanderFish(boTemplate_all); break; } bo.pos = Random.insideUnitSphere + boOrigin; bo.SetWander(1.0f, 4.0f, 0.0f, 0.2f); bo.SetMaxSpeed(0.1f, 0.0005f); boShoal.Add(bo); boLoop++; } if (boTimer == 130) { boTimer = 0; } boTimer++; }
// Start is called before the first frame update void Start() { gegeOrigin = BannerManager.gegeOrigin; heluoOrigin = BannerManager.heluoOrigin; wenyaoOrigin = BannerManager.wenyaoOrigin; boOrigin = BannerManager.boOrigin; xixiOrigin = BannerManager.xixiOrigin; rupiOrigin = BannerManager.rupiOrigin; // GEGE for (int i = 0; i < 1; i++) { gege = new WanderFish(gegeTemplate); gege.pos = Random.insideUnitSphere + gegeOrigin; gege.SetWander(1.0f, 4.0f, 0.0f, 0.2f); gege.SetMaxSpeed(0.1f, 0.0005f); gegeShoal.Add(gege); } // Heluo for (int i = 0; i < 1; i++) { heluo = new WanderFish(heluoTemplate_all); heluo.pos = Random.insideUnitSphere + heluoOrigin; heluo.SetWander(0.2f, 2.0f, 0.0f, 0.3f); heluoShoal.Add(heluo); } }
void GegeUpdate() { if (gegeTimer % 32 == 0 && gegeLoop < 40) { gege = new WanderFish(gegeTemplate); gege.pos = Random.insideUnitSphere + gegeOrigin; gege.SetWander(1.0f, 4.0f, 0.0f, 0.2f); gege.SetMaxSpeed(0.1f, 0.0005f); gegeShoal.Add(gege); gegeLoop++; } if (gegeTimer == 120) { gegeTimer = 0; } gegeTimer++; }