コード例 #1
0
        protected override void Interact(RaycastHit hit)
        {
            if (Mouse.current.leftButton.isPressed)
            {
                if (hit.collider.CompareTag("RoadSectionCollider"))
                {
                    RoadSectionComponent roadSectionComponent = hit.transform.parent.gameObject.GetComponent <RoadSectionComponent>();

                    roadNetwork.DemolishRoad(roadSectionComponent.RoadSection);
                }
                else if (hit.collider.CompareTag("BuildingSelectionCollider"))
                {
                    Building building = hit.rigidbody.gameObject.GetComponent <Building>();

                    buildingManager.DemolishBuilding(building);
                }
            }
        }