void Start() { deadMenu = GetComponent <DeadMenu>(); playableMenu = GetComponent <PlayableMenu>(); playableMenu.ShowScore(currentScore); }
// Start is called before the first frame update void Start() { Move = transform.position; pauseMenu = GameObject.FindGameObjectWithTag("MainCamera").GetComponentInParent <PauseMenu>(); deadMenu = GameObject.FindGameObjectWithTag("MainCamera").GetComponentInParent <DeadMenu>(); }
private void Dead() { _deadAudioEvent.Invoke(); _speed = 0; _body.SetActive(false); _destroyedBody.SetActive(true); DeadMenu.ActiveDeadMenu(); GameObject.Find("Buttons").SetActive(false); }
public void Restart() { transform.position = _startPos; Camera.main.transform.position = _startCameraPos; PlayerMove.Speed = 8f; DeadMenu.ActivationControl(false); _body.SetActive(true); Destroy(_destroyedBody); _buttons.SetActive(true); _isLeave = true; }
private void Dead() { if (_isLeave) { _destroyedBody = Instantiate(_destroyedBodyPrefab); _destroyedBody.transform.parent = transform; _destroyedBody.transform.localPosition = Vector3.zero; _isLeave = false; } _body.SetActive(false); PlayerMove.Speed = 0; _deadAudioEvent.Invoke(); DeadMenu.ActivationControl(true); _buttons.SetActive(false); }
// Start is called before the first frame update void Start() { _bgFar = GameObject.Find("BackgroundFar").GetComponent <BG_Controller>(); _bgMid = GameObject.Find("BackgroundMid").GetComponent <BG_Controller2>(); _bgClose = GameObject.Find("BackgroundClose").GetComponent <BG_Controller3>(); _ground = GameObject.Find("Ground"); _groundAnimated = GameObject.Find("GroundAnimated"); _groundAnimated.SetActive(false); _score = GameObject.Find("Timer").GetComponent <Score>(); //This should not be here //_hero = GameObject.Find("Hero").GetComponent<HeroMovement>(); _heroPrefab = GameObject.Find("Hero"); _heroPrefab.SetActive(false); _car = GameObject.Find("Car"); _hunter = GameObject.Find("Hunter"); _hunterSprite = _hunter.GetComponent <SpriteRenderer>(); _hand = GameObject.Find("HunterArm"); _carAnimator = GameObject.Find("Car").GetComponent <Animator>(); _hunterAnimator = GameObject.Find("Hunter").GetComponent <Animator>(); _obstaclesController = GameObject.Find("Obstacles").GetComponent <ObstaclesController>(); //Activate hunter _hand.SetActive(false); //_hunter.SetActive(false); _hunterSprite.enabled = false; _car.SetActive(false); StartCoroutine(StartGameAfterIntro()); _deadMenu = GameObject.Find("Canvas").GetComponent <DeadMenu>(); skipIntroButton = GameObject.Find("SkipIntro"); }
// Use this for initialization void Start() { player = GetComponentInParent <controls>(); GameObject = GetComponent <DeadMenu>(); score = GetComponentInParent <ScoreManager>(); }
void Start() { DeadMenu = GameObject.FindGameObjectWithTag("DeadMenu").GetComponent <DeadMenu>(); }