private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Player") { PlayerKill?.Invoke(this, EventArgs.Empty); } }
public void LogPlayerKill(Vector3 position, int controller) { string time = GetTime(); PlayerKill newPlayerKill = new PlayerKill(position, controller); AppendToFile(LogPath, ",", "KILL", time, position.x.ToString(), position.y.ToString(), controller.ToString()); }
private void DisplayKillFeed() { string color1, color2, message; int id = _killList.Count; if (Random.Range(0, 10) > 5) { color1 = "<color=#" + _allyTeamColor + ">"; color2 = "<color=#" + _enemyTeamColor + ">"; } else { color1 = "<color=#" + _enemyTeamColor + ">"; color2 = "<color=#" + _allyTeamColor + ">"; } message = color1 + GenerateName() + "</color><color=#FFFFFF> KILLED </color>" + color2 + GenerateName() + "</color>"; PlayerKill _newKill = Instantiate(_playerKill, new Vector2(0, 0), Quaternion.identity); _newKill.Setup(message); _newKill.transform.SetParent(_this.transform); _killList.Add(_newKill); for (int i = 0; i < _killList.Count; i++) { if (i != id) { _killList[i].ActivateShiftDown(); } } }
private void OnSceneGUI() { PlayerKill ScriptKill = (PlayerKill)target; Handles.color = Color.white; Handles.DrawWireArc(ScriptKill.transform.position, Vector3.up, Vector3.forward, 360, ScriptKill.Radius); }
void Update() { if (triggerEvent) { triggerEvent = false; PlayerKill?.Invoke(this, EventArgs.Empty); } }
//check if it collides with the player private void OnTriggerEnter2D(Collider2D collider) { if (collider.tag == "Player") { PlayerKill pk = collider.GetComponent <PlayerKill>(); //Get collider(The player object) playerkill script pk.kill(isDeathWall); //Kill! //Debug.Log("killed!"); } }
private void OnTriggerEnter2D(Collider2D collider) { if (collider.tag == "Player") { PlayerKill pk = collider.GetComponent <PlayerKill>(); //Get collider(The player object) playerkill script pk.kill(false); //Kill! } else if (collider.tag == "Ground") { Destroy(gameObject);//DestroyMe } }
void Awake() { gameManager = GameObject.FindGameObjectWithTag("GM").GetComponent <GameManager>(); playerTraits = GetComponent <PlayerTraits>(); playerKill = GetComponent <PlayerKill>(); dashEffect = (GameObject)Resources.Load("Effects/Dash"); bashEffect = (GameObject)Resources.Load("Effects/Bash"); bumpTimer = gameObject.AddComponent <Timer>(); bumpTimer.Trigger += BumpOff; afterglowTimer = gameObject.AddComponent <Timer>(); afterglowTimer.Trigger += AfterglowOff; dazeTimer = gameObject.AddComponent <Timer>(); dazeTimer.Trigger += DazeOff; }
private void KillPlayer(PlayerKill modo) { switch (modo) { case PlayerKill.ARANHA: case PlayerKill.LASER: //Fumaça case PlayerKill.SERRA: case PlayerKill.WATER: //Afunda na agua default: break; } }
private void OnPlayerKilled(int oldValue, int newValue) { PlayerKill?.Invoke(); }