void GetMouseInfo() { if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); Debug.DrawRay(ray.origin, ray.direction * 100, Color.red, 50); RaycastHit hit; if (Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask)) { if (hit.collider.transform.name == refName) { if (anemometr.isOn) { Debug.Log("Уже включен"); } else { anemometr.SwitchToolState(); //transform.localPosition = activePos; Debug.Log("Теперь включен"); //task AppRootStatic.SetRunedTask(); } } } } }