// Use this for initialization void Start() { manager = GameObject.Find("GameManager").GetComponent <CS_Gamemanager>(); gameManager = FindObjectOfType <CS_Gamemanager>(); Movement = GameObject.FindGameObjectWithTag("Player").GetComponent <CS_Player_Movment>(); movement = GameObject.FindGameObjectWithTag("Player").GetComponent <movment>(); CS_Notify.Register(this, "BiggerCoins"); CS_Notify.Register(this, "ShotCoins"); }
void Start() { CS_Notify.Register(this, "ChangeStage"); playerScript = player.GetComponent <CS_Player_Movment>(); ChangeStage(); progressPlayer.localPosition = new Vector3(progressPlayer.localPosition.x, -300, progressPlayer.localPosition.z); progressEnemy.localPosition = new Vector3(progressEnemy.localPosition.x, -300, progressEnemy.localPosition.z); lastPlayerY = player.transform.position.y; lastEnemyY = tempEnemy.transform.position.y; }
void Start() { Movement = GameObject.FindGameObjectWithTag("Player").GetComponent <CS_Player_Movment>(); movement = GameObject.FindGameObjectWithTag("Player").GetComponent <movment>(); checkIfHit = GameObject.FindGameObjectWithTag("Player").GetComponent <CS_Player>(); boostEffect = GameObject.Find("Speed Particle Effect"); stage = this.gameObject.GetComponent <CS_Stages>(); pickUpParticleText = GameObject.Find("Text_ParticleMaterialMaker").GetComponentInChildren <Text>(); lossParticleText = GameObject.Find("Text_ParticleMaterialMakerLoss").GetComponentInChildren <Text>(); scoreCoins = GameObject.Find("GameManager").GetComponent <CS_Gamemanager>(); dC = GameObject.Find("DeathCounter").GetComponent <CS_DeathCounter>(); Cursor.visible = false; boostEffect.gameObject.SetActive(false); foreach (Transform child in GameObject.FindGameObjectWithTag("TrueCanvas").transform) { if (child.tag == "Score") { score.Add(child.GetComponent <Text>()); } } }
public void death() { dead = true; CS_Notify.Send(this, "StopMoving"); CapsuleCollider2D collider = GetComponent <CapsuleCollider2D>(); collider.enabled = false; CS_Player_Movment movment = GetComponent <CS_Player_Movment>(); movment.enabled = false; CS_Player_Cannons cannons = GetComponent <CS_Player_Cannons>(); cannons.enabled = false; for (int inde = 0; inde < playerSprites.Length; inde++) { playerSprites[inde].gameObject.SetActive(false); } deathAnimation.enabled = true; coins.CalculateFinalScore(); StartCoroutine(onDeath()); }