public void SetLogicCamera(LogicCamera logicCameraToFollow) { DebugUtilities.Assert(logicCameraToFollow != null, "Camera can not be null!"); if (logicCamera) { // cameraInfo.pivotRotation = logicCamera.transform.rotation; } logicCamera = logicCameraToFollow; // logicCamera.OnCameraSwitch(cameraInfo); cameraInfo.cameraSwitched = true; }
public CameraItem AddCameraToStack(LogicCamera camera, string cameraName) { Debug.Log("Adding Camera " + camera.name + " description:" + cameraName); var cameraHandle = new CameraItem(camera, cameraName); cameraStack.Add(cameraHandle); SwitchToCameraWithHighestPriority(); return(cameraHandle); }
public PlayerInteraction.CameraItem AddCameraToStack(LogicCamera camera, string cameraName) { return(player.playerInteraction.AddCameraToStack(camera, cameraName)); }
public CameraItem(LogicCamera cameraToSwitchTo, string _cameraName) { cameraName = _cameraName; DebugUtilities.Assert(cameraToSwitchTo != null, "You can not switch to a null camera"); camera = cameraToSwitchTo; }
public GameObject CreatePlayer(Vector2 StartPos, int LevelNum) { GameObject SceneManager = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefab/" + "SceneManager")); SceneManager.transform.position = new Vector3(StartPos.x, StartPos.y, SceneManager.transform.position.z); m_SceneMover = SceneManager.GetComponent <ScenePathMover> (); m_SceneMover.LoadMiddleScene(LevelNum); m_ShipGroup = SceneManager.transform.Find("ShipGroup").gameObject; m_PlayerCtrl = m_ShipGroup.GetComponent <PlayerCtrl>(); m_Player = SceneManager.transform.Find("ShipGroup/TriangleShipObj").gameObject; TriangleShip ship = m_Player.GetComponent <TriangleShip> (); ship.StartPosObject = SceneManager.transform.Find("ShipGroup/StartPos").gameObject; ship.StartPosObject.SetActive(false); ship.BornPosObject = SceneManager.transform.Find("ShipGroup/BornPos").gameObject; ship.BornPosObject.SetActive(false); ship.CompletePosObject = SceneManager.transform.Find("CompletePos").gameObject; ship.CompletePosObject.SetActive(false); GameCamera = SceneManager.transform.Find("MainCamera").gameObject.GetComponent <LogicCamera>(); GameCamera.SetShip(ship); GameCamera.SetSceneMgrObj(SceneManager); m_EnergyBar = SceneManager.transform.Find("Canvas/EnergyBar").gameObject.GetComponent <EnergyBar>(); m_LifeBar = SceneManager.transform.Find("Canvas/LifeBar").gameObject.GetComponent <LifeBar>(); for (int i = 0; i < ship.GetCurShipLifeTimes(); ++i) { m_LifeBar.AddLife(); } m_ThanksBoard = SceneManager.transform.Find("Canvas/ThanksPlayer").gameObject.GetComponent <ThanksBoard>(); m_ThanksBoard.gameObject.SetActive(false); m_BtnCtrl = SceneManager.transform.Find("Canvas/BtnCtrl").gameObject.GetComponent <ButtonCtrl>(); m_BtnCtrl.SetMainBody(ship); #if UNITY_STANDALONE m_BtnCtrl.gameObject.SetActive(false); #else #endif MusicManager.GetInstance().SFXCtrl = SceneManager.transform.Find("SFXCtrl").gameObject.GetComponent <SoundController>(); MusicManager.GetInstance().BGMCtrl = SceneManager.transform.Find("BGMCtrl").gameObject.GetComponent <BGMController>(); m_GameOverShow = SceneManager.transform.Find("Canvas/GameOver").gameObject; m_GameOverShow.SetActive(false); return(m_Player); }