// Use this for initialization
 void Start()
 {
     smoothFollow2D = GetComponent <SmoothFollow2D>();
     selectedAnimal = GameObject.Find("/UICameraSystem/CameraPositions/SelectedAnimal");
     EventManager.StartListen((int)Events.EXIT_BUTTON_CLICKED, (Action)MoveToOrigin);
     EventManager.StartListen((int)Events.ANIMAL_CLICKED, MoveToSelectedAnimal);
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     PopulatePositions(parentOfPositions);
     smoothFollow2D = Camera.main.GetComponent <SmoothFollow2D>();
     EventManager.StartListen((int)Events.CAMERA_MOVED_TO_ANIMAL, DecreaseOrthographicSize);
     EventManager.StartListen((int)Events.EXIT_BUTTON_CLICKED, IncreaseOrthographicSize);
     EventManager.StartListen((int)Events.ANIMAL_CLICKED, MoveToSelectedAnimal);
 }
Example #3
0
    IEnumerator Start()
    {
        yield return(null); // For everything load

        playerArray = FindObjectsOfType <Player>();
        if (playerArray.Length < 2)
        {
            Destroy(gameObject);
            yield break;
        }
        cam                     = Camera.main;
        smoothFollow2D          = FindObjectOfType <SmoothFollow2D>();
        smoothFollow2D.m_Target = transform;
        yield return(new WaitUntil(() => smoothFollow2D.regularMode));

        yield return(MainRoutine());
    }