// DANNI ALLO CHEF public void ChefDamage(string direction) { chefLife -= playerDamage; // Vita dello Chef - Danni del Player playerAction.chefAnimator.SetTrigger("TakeDamage"); // Animazione danno allo Chef //chefHealth.transform.DOShakePosition(0.7f, 12f); // Shake the Player Image //chefText.transform.DOShakePosition(0.7f, 12f); // Shake the Player Text // FASE INTERMEZZO if (chefLife <= 40 && chefLife > 0 && !isHalfLife && canCutscene) { isHalfLife = true; Debug.Log("Intermediate Fase"); gameManager.CutScene(cutsceneLenght); } // PUGNI FINALI if (chefLife <= 0) { chefLife = 0; gameManager.BlockCoroutine(); // Blocca (currentCouroutine) isFinalPunches = true; // Attiva Pugni Finali } cameraZoom.ZoomIn(direction); // Camera Zoom ChefHealthBar(); // Aggiorna la LifeBar dello Chef }
public void getButtons() { if (Input.GetKey(KeyCode.Plus) || Input.GetKey(KeyCode.Equals)) { //mainCamera.transform.Translate( 0, 0 , Time.deltaTime * zoomSpeed); cameraZoom.ZoomIn(); } if (Input.GetKey(KeyCode.Minus)) { //mainCamera.transform.Translate( 0, 0 , -(Time.deltaTime * zoomSpeed)); cameraZoom.ZoomOut(); } if (Input.GetKeyDown(KeyCode.C)) { Debug.Log("Center was pressed"); //transform.position = Vector3.MoveTowards (transform.position, target.position, speed * Time.deltaTime); } if (Input.GetKeyDown(KeyCode.B)) { //setSelect = false; keyTracker.selection = false; mainMenuPanel.gameObject.SetActive(true); //keyTracker.menuPoint++; //Debug.Log ("B was pressed" + keyTracker.selection); } }
public void NewText(string[] sentencesString, bool _yesOrNo, string[] choicesString, string[] answerString) { yesOrNo = _yesOrNo; if (_yesOrNo) { yes.text = choicesString[1]; no.text = choicesString[0]; _answerString = answerString; } index = 0; ifDone = false; sentences = sentencesString; CameraZoom.ZoomIn(); NextSentence(); }
public void getButtons() { if (Input.GetKey(KeyCode.Plus) || Input.GetKey(KeyCode.Equals)) { //mainCamera.transform.Translate( 0, 0 , Time.deltaTime * zoomSpeed); cameraZoom.ZoomIn(); } if (Input.GetKey(KeyCode.Minus)) { //mainCamera.transform.Translate( 0, 0 , -(Time.deltaTime * zoomSpeed)); cameraZoom.ZoomOut(); } if (Input.GetKeyDown(KeyCode.C)) { Debug.Log("CBang - center toggle is: " + centerToggle); if (centerToggle == false) { Debug.Log("Center on player" + MasterBlackBoard.getActiveAgent().agentName); inFollowMode = true; cameraCenter = MasterBlackBoard.getActiveAgent().transform; centerToggle = true; } else { Debug.Log("Center on waypoint"); centerToggle = false; inFollowMode = false; // cameraCenter = masterBlackBoard.getActiveWayPoint() } //transform.position = Vector3.MoveTowards (transform.position, target.position, speed * Time.deltaTime); } if (Input.GetKeyDown(KeyCode.B)) { //setSelect = false; keyTracker.mainMenuSelect = false; mainMenuPanel.gameObject.SetActive(true); //keyTracker.menuPoint++; //Debug.Log ("B was pressed" + keyTracker.selection); } }
private void OnMouseDown() { if (isDragging || _stateManager.currentPlayerState == StateManager.PlayerState.Dead) { _lineRenderer.enabled = false; return; } _dangerIndicator.ToggleCollider(true); _timescaleManager.SlowdownWhenCharging(); isDragging = true; _lineRenderer.enabled = true; _lineRenderer.SetPosition(0, transform.position); _postProcessingManager.DisableMotionBlur(false); _chargingShake = CameraShaker.Instance.StartShake(0.1f, 0.2f, 0f); _vignetteId = LeanTween.alpha(_vignette.gameObject, 1f, 0.5f).id; _cameraZoom.ZoomIn(); }
// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { Ray ray = m_MainCamera.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { foreach (GameObject child in children) { if (hit.collider == child.GetComponent <Collider>()) { StartCoroutine(rotator); if (zoom != null) { zoom.ZoomIn(); } } } } } }
public static void ZoomIn(this Camera main, Vector3 position, float value) { Canvas[] canvases = GameObject.FindObjectsOfType <Canvas>(); foreach (Canvas temp in canvases) { temp.renderMode = RenderMode.WorldSpace; } CameraZoom cache = main.gameObject.GetComponent <CameraZoom>(); if (cache == null) { main.gameObject.AddComponent <CameraZoom>(); main.gameObject.GetComponent <CameraZoom>().toPosition = new Vector3(position.x, position.y, -10); main.gameObject.GetComponent <CameraZoom>().value = value; main.gameObject.GetComponent <CameraZoom>().ZoomIn(); } else { cache.toPosition = new Vector3(position.x, position.y, -10); cache.value = value; cache.ZoomIn(); } }
private void OnTriggerEnter2D(Collider2D collision) { if (cameraZoom == null) { Debug.LogError("No camera zoom"); } if (collision.transform.CompareTag("Goal")) { float speed = Mathf.Sqrt(rb.velocity.x * rb.velocity.x + rb.velocity.y * rb.velocity.y); if (speed < speedThreshold) { Debug.Log("BOMB SPEED IS BELOW THRESHOLD"); return; } //if (inContact) return; //inContact = true; //print("TRIGGER"); //print(collision.name); //print("zoom zoom"); cameraZoom.ZoomIn(gameObject); } // print("finsihed trigger"); }
public virtual void lose_ball(Vector2 vel, bool sameTeam) { if (sameTeam) { return; } stacker.PlaySound(tackleSound, 1); // get camera zoom GameObject cameraZoomGO = GameObject.FindGameObjectWithTag("MainCamera"); if (cameraZoomGO != null) { cameraZoom = cameraZoomGO.GetComponent <CameraZoom>(); cameraZoom.ZoomIn(gameObject, lose_ball_zoom_time, slow_down_rate); } else { //Debug.Log("Tutorial_Cam: " + tutorial_cam.name); cameraZoom = tutorial_cam.GetComponent <CameraZoom>(); //cameraZoom.ZoomIn(gameObject, lose_ball_zoom_time, slow_down_rate); } has_ball = false; charging = false; ball.transform.parent = null; ball.GetComponent <Ball_Behavior>().dropped(); ball.GetComponent <Rigidbody2D>().velocity = vel; StartCoroutine(ball.GetComponent <Ball_Behavior>().BallNoGrab(1f)); // Debug.Log("Ball velocity: " + ball.GetComponent<Rigidbody2D>().velocity); ball = null; GetStunned(); Commentator c = _AudioMaster.inst.gameObject.transform.GetChild(1).GetComponent <Commentator>(); c.Comment(Commentator.Trigger.Tackle, true); // Debug.Log(gameObject.name + ": DISPOSSESSED!!!"); }
private void Update() { if (Input.GetKey(KeyCode.Escape)) { _fadeTimer -= Time.deltaTime; if (_fadeTimer <= 0) { Application.Quit(); } exitFade.color = new Color(0, 0, 0, 1 - _fadeTimer); } if (Input.GetKeyUp(KeyCode.Escape)) { _fadeTimer = 1f; exitFade.color = new Color(0, 0, 0, 0); } if (_loveBoxInstance != null) { if (_inGame) { _timer += Time.deltaTime; timerText.text = _timer.ToString("0.00").Replace(',', '.'); if (_loveBoxInstance.position.x < -12f || _loveBoxInstance.position.y < -8f) { if (_loveBoxInstance.position.x < -12f) { foundLoveText.gameObject.SetActive(true); } else { foundDeathText.gameObject.SetActive(true); } DestroyPlayer(); _groundInstance.GetComponent <Ground>().PlaceObstacles(false); } } else { if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow)) { _inGame = true; titleText.gameObject.SetActive(false); instructionsText.gameObject.SetActive(false); timerText.gameObject.SetActive(true); _groundInstance.GetComponent <Ground>().PlaceObstacles(true); } } } else { if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow)) { SpawnPlayer(new Vector2(-1f, 8f)); _groundInstance.GetComponent <Ground>().PlaceObstacles(true); } } if (_zoomingIn) { _zoomingIn = mainCamera.ZoomIn(); if (!_zoomingIn) { NextColor(); _zoomingOut = true; } } if (_zoomingOut) { _zoomingOut = mainCamera.ZoomOut(); } }
void OnMouseDown() { Debug.Log(String.Format("Click on {0}", gameObject.name)); zoom.ZoomIn(); }