Example #1
0
        private bool SetupCamera()
        {
            if (!GameCameraObject)
            {
                GameCameraObject = GameObject.Find(CombatGameCameraGOName);
                if (GameCameraObject == null)
                {
                    IsInSimGame = true;
                    if (UnityGameInstance.BattleTechGame.Simulation.CurRoomState == DropshipLocation.SHIP)
                    {
                        GameCameraObject = GameObject.Find(SpaceCameraGOName);
                    }
                    else
                    {
                        GameCameraObject = GameObject.Find(SimGameCameraGOName);
                    }
                }
                else
                {
                    IsInSimGame = false;
                }

                if (!GameCameraObject)
                {
                    return(false);
                }

                if (!IsInSimGame)
                {
                    CameraControl = GameCameraObject.GetComponent <CameraControl>();
                    if (!CameraControl)
                    {
                        return(false);
                    }

                    DebugFlyCameraControl = GameCameraObject.GetComponent <DebugFlyCameraControl>();
                    if (!DebugFlyCameraControl)
                    {
                        return(false);
                    }
                }

                Camera = GameCameraObject.GetComponentInChildren <Camera>();
                if (!Camera)
                {
                    return(false);
                }
            }
            return(true);
        }
Example #2
0
        private bool SetupCamera()
        {
            if (!GameCameraObject)
            {
                GameCameraObject = GameObject.Find(CombatGameCameraGOName);
                if (!GameCameraObject)
                {
                    return(false);
                }

                CameraControl = GameCameraObject.GetComponent <CameraControl>();
                if (!CameraControl)
                {
                    return(false);
                }

                Camera = GameCameraObject.GetComponentInChildren <Camera>();
                if (!Camera)
                {
                    return(false);
                }
            }
            return(true);
        }