void Update() { //Debug.Log(teleportes); timer -= Time.deltaTime; if (timer <= maxTimer * 0.85f) { if (nivelChoro == 0) { textInteragir = "Enxugar lágrimas"; nivelChoro = 1; } if (timer <= 0f) { nivelChoro = 2; textInteragir = ""; KillPlayer kill = GetComponent <KillPlayer>(); kill.enabled = true; Debug.Log("Jump Scare e Matar Player"); } } //mudar de posicao if (necessitaMudarPos) { piscaLanterna(); } }
void OnCollisionEnter2D(Collision2D coll) { if (coll.transform.tag == "Player") { KillPlayer.ReturnToLastCheckpoint(); } }
private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "Player" && !cab.cameraZoom) { KillPlayer.kill(); } }
public void registerKill(NetworkInstanceId netId, int playerKilledId, int playerKillerId) { KillPlayer kp = new KillPlayer(); kp.netId = netId; nm.client.Send(Msgs.killPlayer, kp); pom.killPlayerLocal(playerKilledId, playerKillerId); Debug.Log("Player " + playerKilledId + " died"); }
void OnCollisionEnter2D(Collision2D other) { if("Player" == other.gameObject.name) { kP = other.gameObject.GetComponent<KillPlayer>(); kP.Kill(); } }
void Start() { rb = gameObject.GetComponent <Rigidbody2D>(); rb.velocity = transform.right * speed; killPlayer = gameObject.GetComponent <KillPlayer>(); playerManager = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>(); timeMaster = GameObject.FindGameObjectWithTag("TimeMaster").GetComponent <TimeMaster>(); camShaker = GameObject.FindGameObjectWithTag("CameraShaker").GetComponent <Shake>(); }
// Use this for initialization void Start() { rb2d = gameObject.GetComponent <Rigidbody2D>(); anim = gameObject.GetComponent <Animator>(); kill = FindObjectOfType <KillPlayer>();; ySpeed = 15f; xSpeed = 5f; groundedTimer = 0f; }
public void DamagePlayer(int damage) { playerStats.hp -= damage; Debug.Log(playerStats); if (playerStats.hp <= 0) { killPlayer = GameObject.FindObjectOfType(typeof(KillPlayer)) as KillPlayer; killPlayer.Kill(); } }
private void Update() { CurrentTime -= 0.1f * Time.deltaTime; if (CurrentTime <= 0) { Rigidbody clone; clone = Instantiate(Bullet, transform.position, transform.rotation) as Rigidbody; KillPlayer kill = clone.GetComponent <KillPlayer>(); if (kill != null) { kill.trail.startColor = TriColor; kill.trail.endColor = new Color(TriColor.r, TriColor.g, TriColor.b, 0f); } CurrentTime = Timer; } }
void doWindow(int windowID) { if (GUI.Button(new Rect(windowRect.width / 2 - 50, windowRect.height / 2 + 20, 100, 50), "", quitButtonStyle)) { aud.once = false; aud.twice = false; aud.playing = false; aud.thrice = false; aud.fource = false; UnityEngine.SceneManagement.SceneManager.LoadScene(0); } if (GUI.Button(new Rect(windowRect.width / 2 - 50, windowRect.height / 2 - 60, 100, 50), "", resetButtonStyle)) { KillPlayer.kill(); } }
private void OnTriggerEnter2D(Collider2D collision) { //This is checking the collision for a gameObject that has the //Script 'KillPlayer' Attached to it GameObject checkCollision = collision.gameObject; KillPlayer canKill = checkCollision.GetComponent <KillPlayer>(); if (canKill != null) { respawnPlayer(); } RespawnPoint respawnPoint = checkCollision.GetComponent <RespawnPoint>(); if (respawnPoint != null) { restartPosition = transform.position; } }
void Start() { rb2d = gameObject.GetComponent <Rigidbody2D>(); rb2d.isKinematic = false; anim = gameObject.GetComponent <Animator>(); if (GameObject.FindGameObjectWithTag("cpMaster") != null) { checkpointMaster = GameObject.FindGameObjectWithTag("cpMaster").GetComponent <CheckpointMaster>(); } if (GameObject.FindGameObjectWithTag("DeathBed") != null) { deadlyObjects = GameObject.FindGameObjectWithTag("DeathBed").GetComponent <KillPlayer>(); } if (GameObject.FindGameObjectWithTag("CameraShaker") != null) { cameraShaker = GameObject.FindGameObjectWithTag("CameraShaker").GetComponent <Shake>(); } if (GameObject.FindGameObjectWithTag("TimeMaster") != null) { timeMaster = GameObject.FindGameObjectWithTag("TimeMaster").GetComponent <TimeMaster>(); } if (GameObject.FindGameObjectWithTag("LevelReset") != null) { resetLevel = GameObject.FindGameObjectWithTag("LevelReset").GetComponent <ResetLevel>(); } if (GameObject.FindGameObjectWithTag("GameOverScreen") != null) { gameOverScreen = GameObject.FindGameObjectWithTag("GameOverScreen"); gameOverScreen.SetActive(false); } dash = gameObject.GetComponent <Dash>(); }
public IEnumerator RespawnPlayerCo() { Instantiate(deathParticle, playerController.transform.position, playerController.transform.rotation); playerController.enabled = false; save = playerController.GetComponent <Rigidbody2D>().gravityScale; playerController.GetComponent <Rigidbody2D>().gravityScale = 0f; playerController.GetComponent <Renderer>().enabled = false; cameras.isFollowing = false; playerController.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0); KillPlayer.Killable(false); ScoreManager.AddPoints(-deathPenalty); Debug.Log("Player Respawn"); yield return(new WaitForSeconds(respawnDelay)); //ScoreManager.reset(); playerController.GetComponent <Rigidbody2D>().gravityScale = save; playerController.transform.position = currentCheckpoint.transform.position; cameras.isFollowing = true; playerController.enabled = true; playerController.GetComponent <Renderer>().enabled = true; KillPlayer.Killable(true); Instantiate(respawnParticle, currentCheckpoint.transform.position, currentCheckpoint.transform.rotation); }
void Awake() { rbody = GetComponent <Rigidbody> (); rbody.maxAngularVelocity = 100; // default is 7 swordBox = transform.GetChild(1).gameObject; playerCollider = transform.GetChild(2).gameObject; throwCollider = transform.GetChild(4).gameObject; topDisarm = transform.GetChild(0).gameObject; bottomDisarm = transform.GetChild(3).gameObject; topDisarmScript = topDisarm.GetComponent <SwordDisarm> (); bottomDisarmScript = bottomDisarm.GetComponent <SwordDisarm> (); hitbox = playerCollider.GetComponent <KillPlayer> (); hitbox.killAllPlayers = false; throwHitbox = throwCollider.GetComponent <KillPlayer> (); throwHitbox.killAllPlayers = false; throwCollider.SetActive(false); ChangeOwnership(null); }
// Use this for initialization void Start() { death = FindObjectOfType <KillPlayer>(); }
// Use this for initialization void Start() { gamePlayer = FindObjectOfType <KillPlayer>(); player = GameObject.Find("Player").transform; }
// Use this for initialization void Start() { ms_instance = this; }
// Use this for initialization void Start() { LifeText = GetComponent <Text>(); Killplayer = Player.GetComponent <KillPlayer>(); Lives = 0; }