Example #1
0
    private void RaycastPentagrammonPoint()
    {
        Ray ray;

        if (_camera == null)
        {
            ray = new Ray
            {
                origin    = transform.position,
                direction = transform.forward
            };
        }
        else
        {
            ray = _camera.ScreenPointToRay(Input.mousePosition);
        }

        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, distance, layerMask))
        {
            PentagrammonPoint pentagrammonPoint = hit.collider.GetComponent <PentagrammonPoint>();
            if (pentagrammonPoint != null)
            {
                PentagrammonManager.Instance.PointDrawn(pentagrammonPoint);
            }
        }
    }
Example #2
0
    public void PointDrawn(PentagrammonPoint pentagrammonPoint)
    {
        if (!isReady)
        {
            return;
        }
        uncheckedPentagrammonPoints.Remove(pentagrammonPoint);
        //pentagrammonPoint.GetComponent<MeshRenderer>().enabled = true;

        if (uncheckedPentagrammonPoints.Count == 0)
        {
            pentagramDrawn = true;
            if (OnPentagramDrawn != null)
            {
                OnPentagramDrawn.Invoke();
            }
        }
    }