// Use this for initialization override public void Initialise() { // If nothing else has found the librarian find it if (librarian == null) { librarian = FindObjectOfType <BitWorldLibrarian>(); } base.Initialise(); }
// Start is called before the first frame update override public void Initialise() { if (wheel == null) { wheel = DirectionChoice.Instance; } // Find the sprite with the beacon on SpriteRenderer[] srs = GetComponentsInChildren <SpriteRenderer>(); foreach (SpriteRenderer sr in srs) { if (sr.gameObject != gameObject) { beaconSprite = sr; break; } } librarian = FindObjectOfType <BitWorldLibrarian>(); base.Initialise(); StartBeaconInfo(); // Set beacon sprite info beaconSprite.color = BitWorldKnowledge.Instance.AirColourByWavelength[beaconOutput]; beaconSprite.sprite = librarian.BeaconSprites[(int)pickup]; beaconSprite.transform.eulerAngles = new Vector3(0, 0, 360 - (int)direction * 90); // Give late start method to delegate FindObjectOfType <BitWorldMaker>().LateStartCall += LateStart; // Set input delegates InputManager im = InputManager.Instance; im.ChangeBeaconCall += RotateOutput; im.RotateBeaconCall += RotateDirection; im.PickupCall += ChoosingPickup; im.ChooseDirectionCall += ChoosingDirection; im.SelectionCall += ResolveChoice; }