public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        VRTL = (ValveRealtimeLight)target;

        if (VRTL.m_cachedLight.type == LightType.Directional)
        {
            DirectionalSpace();
        }

        if (VRTL.cookieEnabled == true)
        {
            LCC = FindObjectOfType <LightCookieController>();

            //////////////
            if (LCC != null)
            {
                if (LCC.CookieList != null)
                {
                    //default to first cookie if selection is out of list
                    if (VRTL.cookieNumber + 1 > LCC.CookieList.Length)
                    {
                        VRTL.cookieNumber = 0;
                    }
                    DoCookieSpace();
                }
                else
                {
                    Debug.LogError("No Textures in Cookie Controller");
                    VRTL.cookieEnabled = false;
                }
            }
            else
            {
                Debug.LogError("No Light Controller in Scene");
                VRTL.cookieEnabled = false;
            }
            ///////////////
        }



        GUILayout.BeginHorizontal();

        //if (GUILayout.Button("Add Light Cookie to Array"))
        //{
        //   LCC.CookieList. VRTL.m_cachedLight
        //}

        //if (GUILayout.Button("Apply Array"))
        //{

        //    LCC.ApplyArray();

        //}

        GUILayout.EndHorizontal();
    }
Example #2
0
 void Awake()
 {
     vL = GetComponent <ValveRealtimeLight>();
 }