public void SpeedDown() { IsInvincible = false; speed = 100; foreach (GameObject g in tem_list) { SpotFly _spotfly = g.GetComponent <SpotFly> (); if (_spotfly != null) { _spotfly.speed = 0.0001f * speed; } } }
public void SpeedUp() { IsInvincible = true; speed = 200; foreach (GameObject g in tem_list) { SpotFly _spotfly = g.GetComponent <SpotFly> (); if (_spotfly != null) { _spotfly.speed = 0.0001f * speed; } } GameObject[] enemy = GameObject.FindGameObjectsWithTag("enemy"); foreach (GameObject item in enemy) { JObjectPool._InstanceJObjectPool.RecoveryCertainObj(item.name); } }