private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.name == "Player") { MMan.AddGold(Value); Destroy(gameObject); } }
private void Update() { rotationDisplay.text = "Rotations / s: " + System.Math.Abs(System.Math.Round(global_speed / 6.0, 2)); // Update each gear's speed foreach (DictionaryEntry pair in dist_calculated) { GearDriver gd = GameObject.Find(pair.Key.ToString()).GetComponent <GearDriver>(); gd.Rotate(global_speed * System.Math.Pow(-1, gd.dist)); money_manager.AddGold(System.Math.Abs(global_speed)); } if (!clicked) { UpdateSpeed(); } }