예제 #1
0
    void PlaceBomb()
    {
        int layerMask = 1 << 8;

        ray = cam.ScreenPointToRay(Input.mousePosition);
        if (Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask))
        {
            //MakeBombVisible(true);
            Vector3 pos = new Vector3(0, hit.point.y, hit.point.z);
            itemToPlace.transform.position = pos;
            if (Input.GetMouseButtonUp(0) && timer <= 0)
            {
                itemToPlace.BombPlaced();
                timer = localRechargeRate;
                if (count > 0)
                {
                    count--;
                }
                else
                {
                    localRechargeRate = rechargeRate;
                }
                //MakeBombVisible(false);
            }
            //print(hit.collider.name);
        }
        else
        {
            //MakeBombVisible(false);
        }
    }