private void Update() { if (PlayerHitPoints.GetHitPoints() <= 0) { GameUI.SetActive(false); GameOverPanel.SetActive(true); Days.text = DayCounter.GetComponent <DayCounter>().Counter.text; Time.timeScale = 0; if (!TutorialScript.isTutorialFinished) { TipsPanel.SetActive(true); if (StaticTutorialStage.Stage == StaticTutorialStage.TutorStages.First) { TipsText.text = tutorialScript.FailedStage(); } if (StaticTutorialStage.Stage == StaticTutorialStage.TutorStages.Second) { TipsText.text = tutorialScript.SecondPositionFaile(); } if (StaticTutorialStage.Stage == StaticTutorialStage.TutorStages.Third) { tutorialScript.isRepairDroneReleased = true; tutorialScript.timer = 0; TipsText.text = tutorialScript.ThirdPositionFaile(); } } } }
private void OnTriggerStay(Collider other) { if (readyToStrike) { if (other.CompareTag("Player")) { Explosion.SetActive(true); _isMeteoriteKillEarth = false; PlayerHitPoints.MinusAllHP(); } if (other.CompareTag(Mine.tag)) { if (_isMeteoriteDestroyed) { return; } Explosion.SetActive(true); _isMeteoriteKillEarth = false; _isMeteoriteDestroyed = true; Destroy(other.gameObject); /// ударилось в поле } } }
IEnumerator CheckMeteoriteKillEarth() { yield return(new WaitForSeconds(currentTime)); if (_isMeteoriteKillEarth) { PlayerHitPoints.MinusAllHP(); Debug.Log("ударилось в Землю"); } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { FindObjectOfType <SoundManager>().PlaySoundOneShot(Sound.SoundName.MinusHP); /// ЗАМЕНИТЬ PlayerHitPoints.MinusHP(); Destroy(this.gameObject); } //if (other.CompareTag("Meteorite")) //{ // StartCoroutine(LaterDestroy(0)); //} }
void Start() { if (singleton == null) { singleton = this; } else { Destroy(this); } HitPoints = 3; foreach (var e in HPArray) { e.SetActive(true); } }
private void Awake() { php = GameObject.Find("Player1").GetComponentInChildren <PlayerHitPoints>(); php2 = GameObject.Find("Player2").GetComponentInChildren <PlayerHitPoints2>(); PlayerDead = GetComponent <AudioSource>(); }
// Start is called before the first frame update void Start() { php = GameObject.Find("Body").GetComponent <PlayerHitPoints>(); damageText = GetComponent <TextMesh>(); textColor = GetComponent <TextMesh>().color; }