private void Awake() { if (_instance != null) { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); FritzPoseManager.Configure(); bird.SendMessage("SetController", birdController); birdController.SendMessage("AllPause"); }
void MoveBirdToPoint(lb_Bird bird, Vector3 position) { var distance = Vector3.Distance(bird.transform.position, position); if (!bird.flying && !bird.landing && distance > .4f) { Debug.LogFormat("Starting to fly to {0}", position); bird.SendMessage("FlyToTarget", position); } else if (!bird.flying && !bird.landing) { bird.transform.position = Vector3.Lerp(bird.transform.position, position, Time.deltaTime * 10f); var rotation = Quaternion.LookRotation(m_Cam.transform.position - bird.transform.position); bird.transform.rotation = Quaternion.Slerp(bird.transform.rotation, rotation, Time.deltaTime * 10f); } }
public static void KillAll() { animalHealth[] array = FindObjectsOfType <animalHealth>(); animalHealth[] array2 = array; for (int i = 0; i < array2.Length; i++) { animalHealth animalHealth = array2[i]; if (animalHealth.gameObject.activeInHierarchy) { animalHealth.SendMessage("Die"); } } lb_Bird[] arrayB = FindObjectsOfType <lb_Bird>(); lb_Bird[] arrayB2 = arrayB; for (int i = 0; i < arrayB2.Length; i++) { lb_Bird birdHealth = arrayB2[i]; if (birdHealth.gameObject.activeInHierarchy) { birdHealth.SendMessage("die"); } } }