private int RegisterKiller(Player Killer) { teamkills_count++; if (!GetKills.Exists(x => x.userID == Killer.UserId)) { GetKills.Add(new KillCount { IPv4 = Killer.IpAddress, userID = Killer.UserId, kills = 0 }); this.Debug($"Killer added"); } int index = GetKills.FindIndex(x => x.userID == Killer.UserId || x.IPv4 == Killer.IpAddress); this.Debug($"Killer index: {index}"); if (!act_combo.Contains(GetKills[index].userID)) { act_combo.Add(GetKills[index].userID); if (settings.autobans) { ComboCounter(index).GetAwaiter(); } this.Debug($"Killer counter starts"); } GetKills[index] = new KillCount { userID = Killer.UserId, IPv4 = Killer.IpAddress, kills = GetKills[index].kills + 1 }; return(index); }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "drop") { Destroy(other.gameObject); KillCount.increment(); AudioSource.PlayClipAtPoint(oilDeath, transform.position); } }
private void Awake() { killCount = 0; if (instance == null) { instance = this; } else { Destroy(gameObject); } }
void OnTriggerEnter(Collider col) { if (col.gameObject.tag == "Player" || col.gameObject.tag == "PlayerBase") { Destroy(transform.parent.gameObject); //KillCount.killConfirmed(); //KillCount.kills += 1; KillCount.kills += 1; KillCount.killConfirmed(); //KillCount.killConfirmed(KillCount.kills); } }
void OnTriggerEnter(Collider col) { if (col.gameObject.tag == "Player" && col.gameObject.transform.position.y > this.gameObject.transform.position.y) { Destroy(transform.parent.gameObject); //KillCount.killConfirmed(); //KillCount.kills += 1; //KillCount.kills += 1; KillCount KillCount = GameObject.Find("DisplayCanvas/CoinScoreSystem").GetComponent(typeof(KillCount)) as KillCount; KillCount.killConfirmed(); //KillCount.killConfirmed(KillCount.kills); } }
void OnTriggerEnter(Collider other) { if (other.tag == "Player") { PlayerControllerAnimation.PowerUp = 1; Destroy(gameObject); //KillCount.killConfirmed(); //KillCount.kills += 1; //KillCount.kills += 1; KillCount KillCount = GameObject.Find("DisplayCanvas/CoinScoreSystem").GetComponent(typeof(KillCount)) as KillCount; KillCount.killConfirmed(); //KillCount.killConfirmed(KillCount.kills); } }
public void PerformSave() { float[] buttonslist = SHandler.returnButtons (); BinaryFormatter binary = new BinaryFormatter (); FileStream fStream = File.Create (Application.persistentDataPath + "/19882609.dru"); KillCount saver = new KillCount (); saver.s_cps = CHandler.cps; saver.s_Count = CHandler.totalClouds; saver.s_CValue = CHandler.clickValue; saver.b_values = buttonslist; saver.s_clicks = TStuff.returnScore (); binary.Serialize (fStream, saver); fStream.Close (); CloseUI (); }
void OnTriggerEnter(Collider other) { print(other.tag); if (other.tag == "MovingEnemy" || other.tag == "BouncyProjectileEnemy" || other.tag == "ExplodingEnemy") { Destroy(other.gameObject); //KillCount.killConfirmed(); //KillCount.kills += 1; //KillCount.kills += 1; //KillCount.killConfirmed(KillCount.kills); KillCount KillCount = GameObject.Find("DisplayCanvas/CoinScoreSystem").GetComponent(typeof(KillCount)) as KillCount; KillCount.killConfirmed(); } }
void Start() { _camera = GameObject.Find("Character").GetComponentInChildren <Camera>(); _gm = GameObject.Find("__Game").GetComponent <GameManager>(); _kc = GameObject.Find("Kills").GetComponent <KillCount>(); foreach (Transform child in transform) { if (child.transform.gameObject.name == "Sphere") { _canvas = child.GetChild(0).GetComponent <Canvas>(); _nameBox = child.GetChild(0).GetChild(0).GetComponent <Text>(); } } _nameBox.text = transform.name; }
public void PerformSave() { float[] buttonslist = SHandler.returnButtons(); BinaryFormatter binary = new BinaryFormatter(); FileStream fStream = File.Create(Application.persistentDataPath + "/19882609.dru"); KillCount saver = new KillCount(); saver.s_cps = CHandler.cps; saver.s_Count = CHandler.totalClouds; saver.s_CValue = CHandler.clickValue; saver.b_values = buttonslist; saver.s_clicks = TStuff.returnScore(); binary.Serialize(fStream, saver); fStream.Close(); CloseUI(); }
public void Load() { if (File.Exists(Application.persistentDataPath + "/19882609.dru")) { BinaryFormatter binary = new BinaryFormatter(); FileStream fStream = File.Open(Application.persistentDataPath + "/19882609.dru", FileMode.Open); KillCount saver = (KillCount)binary.Deserialize(fStream); fStream.Close(); CHandler.cps = saver.s_cps; CHandler.totalClouds = saver.s_Count; CHandler.clickValue = saver.s_CValue; SHandler.ButtonLoad(saver.b_values); TStuff.AcceptScore(saver.s_clicks); //etc. SHandler.UpdateItems(); } }
// Use this for initialization void Start () { lifeTime = 25; timer = 0; kc = GameObject.Find("KillCount").GetComponent<KillCount>(); }
private void Start() { _kill_counter = GameObject.Find("KillCounter").GetComponent <KillCount>(); }