/// <summary>
 /// Function should be called from the awake function of room's actor
 /// </summary>
 /// <param name="RoomThatWasLoaded"></param>
 public void OnRoomWasLoaded(RoomActor RoomThatWasLoaded)
 {
     if (CurrentlyLoadedRoom == RoomThatWasLoaded)
     {
         return;
     }
     CurrentlyLoadedRoom = RoomThatWasLoaded;
     if (MainGameCamera)
     {
         MainGameCamera.OnRoomLoaded(CurrentlyLoadedRoom);
     }
 }
    // Update is called once per frame
    void Update()
    {
        if (!Camera_01)
        {
            Camera_01 = GameObjectTracker.instance.GameCamera;

            //Set teh camera to look at the bot.
            Camera_01.SetBotToFollow(Bot_01);
            //GameObjectTracker.instance.

            //Set teh game camera as the current game camera.
            Camera.SetupCurrent(Camera_01.MyCamera);
        }

        //Perform the basic controller upate of pushing the bots based on their input.
        MovementControllerUpdate();

        //We will call our test controls here if we need to.
        TestControls();


        if (!deviceCheck)
        {
            CheckDevice();
        }

        //Handle Time
        //Set the slow motion timer if we are in slow motion.
        if (IsSlowMotion && !TimePaused)
        {
            //Update the timer
            SlowMotionTimer -= Time.deltaTime;

            Time.timeScale = timescaleslow;

            if (SlowMotionTimer < 0.0f)
            {
                IsSlowMotion    = false;
                Time.timeScale  = timescalenormal;
                SlowMotionTimer = -1.0f;
            }
        }
    }
Example #3
0
    void SetUpCamera(params GameObject[] boards)
    {
        var camera = GameObject.FindGameObjectWithTag("MainCamera");
        List <Transform> boardsTransforms = new List <Transform> ();

        foreach (GameObject board in boards)
        {
            boardsTransforms.Add(board.GetComponent <Transform> ());
        }

        if (camera != null)
        {
            var sc = camera.GetComponent <MainGameCamera> ();
            if (sc != null)
            {
                sc.Init(boardsTransforms.ToArray(), 1);
                _camera = sc;
            }
        }
    }
 void Start()
 {
     _cm = GetComponent <MainGameCamera> ();
 }
 void Start()
 {
     _cm     = GetComponent <MainGameCamera> ();
     uiUtils = GameObject.FindGameObjectWithTag("GameController").GetComponent <UIUtils> ();
 }