private void Update() { if (hauseTarget) { return; } _circleDraw.SetRadius(_influeceRadius); if (weightSlider != null) { weightSlider.value = 0.5f + (_weight / 50) * 0.5f; } if (Input.GetMouseButtonUp(1)) { adjustRadius = false; } if (adjustRadius) { // Pixel coordinates of mouse (x,y) Vector3 mousePoint = Input.mousePosition; // z coordinate of game object on screen mousePoint.z = Camera.main.WorldToScreenPoint(gameObject.transform.position).z; _influeceRadius = Mathf.Abs((Camera.main.WorldToScreenPoint(transform.position) - mousePoint).magnitude) * 0.2f; _weight += Input.mouseScrollDelta.y * 4f; } }
// Use this for initialization void Start() { sprite.SetActive(true); circle_drawer.enabled = true; circle_drawer.SetRadius(radius); spawn_time = Time.time; bomb_collider.radius = radius; }