// Update is called once per frame void Update() { if (Input.GetButtonDown("Jump")) { //restart game GameStatsScript gameStatsScript = GameObject.Find("GameStats").GetComponent <GameStatsScript>(); //gameStatsScript.ResetScore(); SceneManager.LoadScene("Level1"); } }
// Use this for initialization void Start() { this.blockParent = this.GetComponentInParent<BlockCoins> (); this.blockParentAnimator = this.GetComponentInParent<Animator>(); this.gameStatsScript = GameObject.Find("GameStats").GetComponent<GameStatsScript>(); }
// Use this for initialization void Start() { this.rigidBody = this.GetComponent<Rigidbody2D>(); this.boxCollider = this.GetComponent<BoxCollider2D>(); this.animator = this.GetComponent<Animator>(); this.gameStatsScript = GameObject.Find("GameStats").GetComponent<GameStatsScript>(); if(this.size == "Big") { this.Grow(); } if(this.skin == "Fire") { this.SetSkin(this.skin); } }
// Use this for initialization void Start() { this.player = GameObject.FindWithTag("Player"); this.playerScript = this.player.GetComponent<PlayerScript>(); this.boxCollider = this.GetComponent<BoxCollider2D>(); this.patrolScript = this.GetComponent<PatrolScript>(); this.gameStatsScript = GameObject.Find("GameStats").GetComponent<GameStatsScript>(); Physics2D.IgnoreCollision( this.boxCollider, this.player.GetComponent<BoxCollider2D>() ); this.rigidBody = this.GetComponent<Rigidbody2D>(); this.animator = this.GetComponent<Animator>(); if(this.hasWings) { this.InitFlight(); } }