public override void OnInspectorGUI() { base.OnInspectorGUI(); CameraOrbit myScript = (CameraOrbit)target; if (GUILayout.Button("Aiming view")) { myScript.ChangeCameraView("Aiming"); } if (GUILayout.Button("Walking view")) { myScript.ChangeCameraView("Walking"); } if (GUILayout.Button("Platform view")) { myScript.ChangeCameraView("Platform"); } if (GUILayout.Button("Fighting view")) { myScript.ChangeCameraView("Fighting"); } }
private void Start() { startPosCannonTop = cannonTop.localPosition; startPosCannonBottom = cannonBottom.localPosition; camOrbit = Camera.main.GetComponentInParent <CameraOrbit>(); }
// Start is called before the first frame update void Start() { dropdown.ClearOptions(); dropdown.AddOptions(objects.Select(r => r.gameObject.name).ToList()); cameraOrbit = Camera.main.GetComponent <CameraOrbit>(); }
// Use this for initialization void Start() { cameraTransform = GameObject.FindGameObjectWithTag("MainCamera"); gamehandler = new GameHandler(); spawnPoint = transform.position; cameraScript = cameraTransform.GetComponent <CameraOrbit>(); }
protected override void InitializeInner() { Camera = new CameraOrbit(45) { Alpha = 30.0f, Beta = 25.0f, NearZ = 0.1f, Radius = 5.5f, Target = Vector3.Zero }; Scene.Add(_box1 = new RenderableList { new TestingCube() }); _box2s = new RenderableList(null, Matrix.RotationX(90.5f) * Matrix.Translation(0.0f, 0.0f, 3.0f)) { new TestingCube() }; Scene.Add(_box2 = new RenderableList { new TestingCube(), _box2s }); Scene.Add(_box3 = new RenderableList { new TestingCube() }); Scene.Add(_box4 = new RenderableList { new TestingCube() }); }
//-refactor void Awake() { movement = GameObject.Find("Player Controlled Cube").GetComponent <Movement>(); mcamera = GameObject.Find("Main Camera").GetComponent <CameraOrbit>(); levelchecker = GameObject.Find("Grid").GetComponent <Levels>(); grid = GameObject.Find("Grid").GetComponent <Grid>(); }
private void Awake() { thresholdColors[0] = new Color(0, 0, 0, 0.8f); thresholdColors[1] = new Color(1f, 0, 0, 1f); thresholdColors[2] = new Color(0.5f, 0.5f, 0.5f, 1f); if (colorButtons[0] != null) { colorButtons[0].color = thresholdColors[0]; } if (colorButtons[1] != null) { colorButtons[1].color = thresholdColors[1]; } if (colorButtons[2] != null) { colorButtons[2].color = thresholdColors[2]; } colorsVisible[0] = true; colorsVisible[1] = true; colorsVisible[2] = true; maps = new List <Colormap>(); bgButton.color = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>().backgroundColor; brainButton.color = _brainLeftRenderer.material.color; _play.onClick.AddListener(Play); mCamera = GameObject.FindWithTag("MainCamera").transform.parent.GetComponent <CameraOrbit>(); }
void Start() { _charController = GetComponent <CharacterController>(); mainCamera = Camera.main.transform; cam = mainCamera.GetComponent <CameraOrbit>(); animator = GetComponent <Animator>(); weapon = GetComponent <PlayerWeaponAndAttacks>(); }
private static float GetMaxCornerOffset(CameraOrbit camera) { camera.UpdateViewMatrix(); var test = camera.Target + camera.Right * camera.Radius * 0.01f; return(Vector3.TransformCoordinate(test, camera.ViewProj).X.Abs()); }
private void OnEnable() { if (cameraOrbit == null) { cameraOrbit = (CameraOrbit)target; cameraOrbit.transform.localScale = Vector3.one * cameraOrbit.radius; } }
void Start() { updateStartPosition(); stoneRenderer = GetComponentInChildren <Renderer> (); mat = stoneRenderer.material; parent = this; cameraOrbit = FindObjectOfType <CameraOrbit>(); }
protected override void InitScene() { base.InitScene(); //enable orbit Camera CameraOrbit = CameraNode.CreateComponent <CameraOrbit>(); InputManager.Add(CameraOrbit); }
void Awake() { //movement = GameObject.Find("Player Controlled Cube").GetComponent<Movement>(); mcamera = GameObject.Find("Main Camera").GetComponent <CameraOrbit>(); soundmanager = GameObject.Find("Main Camera").GetComponent <SoundManager>(); sceneloader = GameObject.Find("SceneManager").GetComponent <SceneLoader>(); //levelchecker = GameObject.Find("Grid").GetComponent<Levels>(); //grid = GameObject.Find("Grid").GetComponent<Grid>(); }
private void Start() { Cursor.lockState = CursorLockMode.Locked; startPosArmL = armL.localPosition; startPosArmR = armR.localPosition; camOrbit = Camera.main.GetComponentInParent <CameraOrbit>(); }
// Start is called before the first frame update void Start() { //currentLevel = Instantiate(levels[0], levels[0].transform.position, Quaternion.identity); //levelCounter++; initialLevelPosition = new Vector3(currentLevel.transform.position.x, currentLevel.transform.position.y, currentLevel.transform.position.z); cameraOrbitScript = mainCamera.GetComponent <CameraOrbit>(); mind = FindObjectOfType <MindControlController>(); indicator = mind.GetComponent <ClickIndicator>(); }
void Start() { Cursor.lockState = CursorLockMode.Locked; // locks cursor on screen and makes it invisible // Getting arms local position startPosArmL = armL.localPosition; startPosArmR = armR.localPosition; camOrbit = Camera.main.GetComponentInParent <CameraOrbit>(); // Getting camera }
private void Start() { menu = transform.GetChild(0).gameObject; menu.SetActive(false); camera = Camera.main.GetComponent <CameraOrbit>(); viewButton.onClick.AddListener(OnViewButton); targetButton.onClick.AddListener(OnTargetButton); missileButton.onClick.AddListener(OnMissileButton); }
void Start() { cam = GetComponentInChildren <CameraOrbit>(); rb = GetComponent <Rigidbody>(); pBlob = GetComponent <Blob>(); pBlob.isPlayer = true; pBlob.Resize(.6f); LevelManager.manager.blobs.Add(pBlob); this.name = "You!"; }
void Start() { // Lock the mouse cursor to the edges of the screen Cursor.lockState = CursorLockMode.Locked; camOrbit = Camera.main.GetComponentInParent <CameraOrbit>(); startPosArmLeft = armLeft.localPosition; startPosArmRight = armRight.localPosition; }
void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
private void Start() { Cursor.lockState = CursorLockMode.Locked; startPosArmL = armL.localPosition; startPosArmR = armR.localPosition; soundPlayer = GetComponentInChildren <AudioSource>(); camOrbit = Camera.main.GetComponentInParent <CameraOrbit>(); }
private void OnValidate() { if (VirtualCamera == null) { VirtualCamera = GetComponent <Cinemachine.CinemachineVirtualCamera>(); } if (CameraOrbit == null) { CameraOrbit = GetComponent <CameraOrbit>(); } }
//private bool isInGamePlay = true; void Awake() { sceneLoader = GameObject.Find("SceneManager").GetComponent <SceneLoader>(); if (sceneLoader.isSolutionScene()) { movement = GameObject.Find("Player Controlled Cube").GetComponent <Movement>(); } if (sceneLoader.isProblemScene() || sceneLoader.isSolutionScene()) { cameraOrbit = GameObject.Find("Main Camera").GetComponent <CameraOrbit>(); } }
public MainVisualHeightField(IRenderState renderState, IContentLoader contentLoader) { renderState.Set(BoolState <IDepthState> .Enabled); renderState.Set(BoolState <IBackfaceCullingState> .Enabled); texDiffuse = contentLoader.Load <ITexture2D>("capsule0.jpg"); shaderProgram = contentLoader.Load <IShaderProgram>("shader.*"); //load geometry var mesh = Meshes.CreatePlane(100, 100, 1024, 1024); geometry = VAOLoader.FromMesh(mesh, shaderProgram); camera = new CameraOrbit(); }
private void Awake() { instance = this; myTransform = transform; xValue = myTransform.eulerAngles.y; yValue = myTransform.eulerAngles.x; targetDistanceToTarget = distanceToTarget; //layerToHit = (1 << LayerMask.NameToLayer("Ground")) | (1 << LayerMask.NameToLayer("Water")); }
// Use this for initialization void Start() { // Lock the mouse Cursor.lockState = CursorLockMode.Locked; //(didn't realise it was this easy) // Hide cursor Cursor.visible = false; CameraOrbit cam = GetComponentInChildren <CameraOrbit>(); if (cam != null) { mainCamera = cam.gameObject; } }
public GameObject CreateCamera(GameObject shipObject, string model) { GameObject cameraPrefab = (GameObject)Resources.Load("Prefabs/Cameras/Capital/" + model + " Camera"); GameObject cameraObject = Instantiate(cameraPrefab); cameraObject.transform.name = "Main Camera"; CameraOrbit orbit = cameraObject.GetComponentInChildren <CameraOrbit>(); orbit.focus = shipObject.transform; orbit.Initiate(); return(cameraObject); }
void OnMouseDown() { _heartVFX.Emit(CameraOrbit.GetClickStrength()); _lastClickTime = Time.time; _clickTween.Play(); if (_goToTargetRoutine != null) { StopCoroutine(_goToTargetRoutine); _goToTargetRoutine = null; } }
void Awake() { _instance = this; _Horizontal.Goal = _Horizontal.DefaultValue; _Vertical.Goal = _Vertical.DefaultValue; _Zoom.Goal = _Zoom.DefaultValue; if (_AutoRegisterForGL) { RegisterPostRenderCallback(GL3D.Instance.DrawNow); } }
public void Render(CameraOrbit camera) { if (ReferenceEquals(null, shaderObject)) { return; } if (ReferenceEquals(null, shaderShadow)) { return; } // calculate value for candle light flickering timeSpan = stopWatch.Elapsed; double elapsedTime = timeSpan.TotalMilliseconds; var factor = 1; if (smokeState) { factor = 4; } float candleFlickering = (float)Math.Sin((elapsedTime / 1000 / factor) + (.2 + random.NextDouble())) / 30 * factor; // setup light for shadow cameraLight.Distance = this.lightPosition[1] + candleFlickering; var light = cameraLight.CalcMatrix().ToOpenTK(); shaderShadow.Activate(); fboShadowMap.Activate(); GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); GL.UniformMatrix4(shaderShadow.GetUniformLocation("camera"), true, ref light); this.DrawScene(shaderShadow, cameraLight, candleFlickering); fboShadowMap.Deactivate(); shaderShadow.Deactivate(); GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); shaderObject.Activate(); fboShadowMap.Texture.Activate(); var cam = camera.CalcMatrix().ToOpenTK(); GL.UniformMatrix4(shaderObject.GetUniformLocation("camera"), true, ref cam); GL.UniformMatrix4(shaderObject.GetUniformLocation("light"), true, ref light); this.DrawScene(shaderObject, camera, candleFlickering); fboShadowMap.Texture.Deactivate(); shaderObject.Deactivate(); // draw environment shaderObject.Activate(); this.DrawEnvironment(shaderObject, camera); shaderObject.Deactivate(); }
void Awake() { instance = this; }
void Start() { cOrbit = GetComponent<CameraOrbit>(); GoTo("PhysicalForm"); fm = GameObject.FindObjectOfType<FormsManager>(); }
// Use this for initialization void Start() { tickCount = 0; GuiColor.a = 1.0f; CameraScript = GameObject.Find("Main Camera").GetComponent<CameraOrbit>(); }
void Start() { GameObject cam = GameObject.Find ("Main Camera"); camOrbit = cam.GetComponent<CameraOrbit>(); }