예제 #1
0
    void Interact()
    {
        if (lightfilterScript == null)
        {
            //Check Player Inventory
            if (PlayerInventory.LightFilters.Count > 0)
            {
                Transform lightFilter = PlayerInventory.LightFilters[PlayerInventory.LightFilters.Count - 1];
                lightFilter.position = placementPoint.position;
                lightFilter.parent   = this.transform;

                lightfilterScript = lightFilter.GetComponent <LightFilterHandler>();

                lightfilterScript.ChangeColor(lightFilterColor);

                lightFilter.gameObject.SetActive(true);

                PlayerInventory.RemoveItem(Item.ItemType.LightFilter);
            }
        }
        else
        {
            lightfilterScript = null;
        }
    }
예제 #2
0
    void HitLightFilter(GameObject filter, int index, RaycastHit hit, Vector3 rayDir)
    {
        if (lightFilter == null || lightFilter != filter)
        {
            lightFilter       = filter;
            lightFilterScript = lightFilter.GetComponent <LightFilterHandler>();
        }

        if (index < numberOfReflections - 1)
        {
            lineRenderer.SetPosition(index + 1, hit.point);
        }

        int numOfReflections = numberOfReflections - index;

        //TODO: Add in Light Filter Behaviour
        lightFilterScript.GetRayHitPoint(hit.point, rayDir, 3);
    }