private void RightMouseClick() { WorldObject sel = player.SelectedObject; if (player.hud.MouseInBounds() && sel) { GameObject hitObject = FindHitObject(); Vector3 hitPoint = FindHitPoint(); Debug.Log(hitPoint + " on " + hitObject); if (hitObject && hitPoint != ResourceManager.InvalidPosition) { //if (player.SelectedObject is Unit) // Debug.Log("Unit!"); sel.ActionOnObject(hitPoint, hitObject.GetComponentInChildren <WorldObject>(), player); } } }