// Use this for initialization void Start() { pivoter = CameraManager.instance.GetComponent <CameraPivot>(); BasketObject.transform.LookAt(RotationPoint.position); BasketObject.transform.position = RotationPoint.position + Vector3.back * GameManager.instance.BasketDepth; }
// Use this for initialization void Start() { CameraPivot cameraPivot = (CameraPivot)FindObjectOfType(typeof(CameraPivot)); playerCamera = cameraPivot.GetComponentInChildren <Camera>(); P = playerCamera.projectionMatrix; }
void Start() { TextureLoader.e.LoadImages(); var pivots = CameraPivot.GetAllInScene(); pivot = pivots[0]; //Vector3[] points = pivots[0].Points; spritePointer = spriteRenderer.GetComponent <PointTowardsCamera>(); }
public void doIt(GameObject gameObject) { Scalable scalable = gameObject.AddComponent <Scalable>(); CameraPivot cameraPivot = FindObjectOfType <CameraPivot>(); Debug.Assert(cameraPivot != null); Debug.Assert(ecManager != null); ecManager.player = scalable; scalable.cameraPivot = cameraPivot; }
// Use this for initialization void Start() { ballControl = GetComponent <BallControl>(); //Create player camera if (createCamera) { CameraPivot cpivot = (CameraPivot)Instantiate(cameraPivotObject); cpivot.name = "CameraPivot_" + this.gameObject.name; cpivot.target = ballControl.gameObject; cameraPivot = cpivot.GetComponent <SmoothMouseLook>(); } }
public void doIt(GameObject gameObject) { // 鎖Camera CameraPivot cameraPivot = FindObjectOfType <CameraPivot>(); Debug.Assert(cameraPivot != null); cameraPivot.lockYaw = true; cameraPivot.adjustYaw(degree); PlanetPlayerController ppc = gameObject.GetComponent <PlanetPlayerController>(); Debug.Assert(ppc != null); ppc.doDergeeLock = true; }
//////////////////////////////////////////////// //////////////////////////////////////////////// void Awake() { Camera_Pivot = transform.FindDeepChild("CameraPivot").GetComponent <CameraPivot>(); if (Camera_Pivot == null) { Debug.LogError("We got a problem here"); } CameraContainer = Camera_Pivot.transform.Find("CameraObject"); if (CameraContainer == null) { Debug.LogError("We got a problem here"); } MainCamera = CameraContainer.GetComponent <Camera>(); if (_camera == null) { Debug.LogError("We got a problem here"); } _camera.enabled = false; }
//////////////////////////////////////////////// //////////////////////////////////////////////// void Awake() { _cameraPivot = transform.Find("CameraPivot"); if (_cameraPivot == null) { Debug.LogError("We got a problem here"); } _cameraObject = transform.FindDeepChild("CameraObject"); if (_cameraObject == null) { Debug.LogError("We got a problem here"); } _camera = _cameraObject.GetComponent <Camera>(); if (_camera == null) { Debug.LogError("We got a problem here"); } _cameraPivotScript = _cameraPivot.GetComponent <CameraPivot>(); _camera.enabled = false; }
CameraPivot GetCameraPivot() { return(cameraPivot ? cameraPivot : cameraPivot = FindObjectOfType <CameraPivot>()); }
private void Awake() { pivot = FindObjectOfType <CameraPivot>(); sphericalCoordinate = new SphericalCoordinate(transform.position, 5.0f, 5.0f, 10.0f, 0.0f, 85.0f); }
public void FindPivot() { _pivot = FindObjectOfType <CameraPivot>(); }
void Awake() { instance = this; Invoke("enableCamera", 0.1f); }
// Start is called before the first frame update void Start() { camUp = FindObjectOfType <CameraPivot>(); currentWaypoint = 0; }
internal void Init(Preset preset) { m_Preset = preset; // TODO: May be we shouldn't re-parent to preset. transform.SetParent(preset.transform, false); GameObject tmp; // ChaseOffset tmp = AddChild("ChaseTargetOffset", transform); m_ChaseTargetOffsetHandler = tmp.AddComponent <SpaceOffset>(); m_ChaseTargetOffsetHandler.transform.localPosition = preset.m_VirtualPosition.m_TargetOffset; m_ChaseTargetOffsetHandler.Init(preset, this, Color.white.SetAlpha(.4f)); // Yaw tmp = AddChild("Yaw", m_ChaseTargetOffsetHandler.transform); m_YawHandler = tmp.AddComponent <ArcYaw>(); m_YawHandler.Init(preset, this, Color.red.SetAlpha(.05f), Color.red.SetAlpha(.5f)); m_YawHandler.Degree = preset.m_VirtualPosition.m_Camera.m_Coordinates.Yaw; // Pitch tmp = AddChild("Pitch", m_YawHandler.transform); m_PitchHandler = tmp.AddComponent <ArcPitch>(); m_PitchHandler.Init(preset, this, Color.blue.SetAlpha(.05f), Color.blue.SetAlpha(.5f)); m_PitchHandler.Degree = preset.m_VirtualPosition.m_Camera.m_Coordinates.Pitch; // Distance tmp = AddChild("OrbitDistance", m_PitchHandler.transform); m_OrbitDistance = tmp.AddComponent <OrbitDistance>(); m_OrbitDistance.Init(preset, this); m_OrbitDistance.Slider = preset.m_VirtualPosition.m_Camera.m_Coordinates.radius; // Zoom tmp = AddChild("ZoomRange", m_OrbitDistance.transform); m_ZoomHandler = tmp.AddComponent <OrbitDistance>(); m_ZoomHandler.Init(preset, this); m_ZoomHandler.Slider = 0f; // Camera Offset tmp = AddChild("CameraOffset", m_ZoomHandler.transform); m_CameraOffsetHandler = tmp.AddComponent <SpaceOffset>(); m_CameraOffsetHandler.transform.localPosition = preset.m_VirtualPosition.m_CameraOffset; m_CameraOffsetHandler.transform.rotation = Quaternion.LookRotation(-m_CameraOffsetHandler.transform.forward, m_CameraOffsetHandler.transform.up); m_CameraOffsetHandler.Init(preset, this, Color.white.SetAlpha(.4f)); // Idea orbit position tmp = AddChild("CameraOrbitPivot", m_CameraOffsetHandler.transform); m_CameraOrbitPivot = tmp.transform; // final position tmp = AddChild("CameraPivot", m_CameraOrbitPivot); m_CameraPivot = tmp.AddComponent <CameraPivot>(); m_CameraPivot.Init(preset, this); // Virtual look at point // Yaw tmp = AddChild("YawLookAt", m_ChaseTargetOffsetHandler.transform); m_YawLookAtHandler = tmp.AddComponent <BaseYaw>(); m_YawLookAtHandler.Init(preset, this); m_YawLookAtHandler.Degree = preset.m_VirtualPosition.m_LookTarget.m_Coordinates.Yaw; // Pitch tmp = AddChild("PitchLookAt", m_YawLookAtHandler.transform); m_PitchLookAtHandler = tmp.AddComponent <BasePitch>(); m_PitchLookAtHandler.Init(preset, this); m_PitchLookAtHandler.Degree = preset.m_VirtualPosition.m_LookTarget.m_Coordinates.Pitch; // Distance tmp = AddChild("OrbitDistance", m_PitchLookAtHandler.transform); m_OrbitLookAtDistance = tmp.AddComponent <OrbitDistance>(); m_OrbitLookAtDistance.Init(preset, this); m_OrbitLookAtDistance.Slider = preset.m_VirtualPosition.m_LookTarget.m_Coordinates.radius; // Point tmp = AddChild("LookAtPivot", m_OrbitLookAtDistance.transform); m_LookAtPivot = tmp.transform; }