Пример #1
0
        void OnEnable()
        {
            m_TypedTargets   = targets.Cast <ReflectionProxyVolumeComponent>().ToArray();
            m_SerializedData = new SerializedReflectionProxyVolumeComponent(serializedObject);

            m_UIState.Reset(m_SerializedData, Repaint);

            m_UIHandlerState = new ReflectionProxyVolumeComponentUI[m_TypedTargets.Length];
            for (var i = 0; i < m_UIHandlerState.Length; i++)
            {
                m_UIHandlerState[i] = new ReflectionProxyVolumeComponentUI();
            }
        }
        void OnEnable()
        {
            m_SerializedData = new SerializedReflectionProxyVolumeComponent(serializedObject);
            System.Array.Resize(ref m_TypedTargets, serializedObject.targetObjects.Length);
            for (int i = 0; i < serializedObject.targetObjects.Length; ++i)
            {
                m_TypedTargets[i] = (ReflectionProxyVolumeComponent)serializedObject.targetObjects[i];
            }

            m_SphereHandle = new HierarchicalSphere(k_HandleColor);
            m_BoxHandle    = new HierarchicalBox(k_HandleColor, new[] { k_HandleColor, k_HandleColor, k_HandleColor, k_HandleColor, k_HandleColor, k_HandleColor })
            {
                monoHandle = false
            };
        }
        void InstantiateProxyVolume(SerializedObject serializedObject)
        {
            var objs = new List <Object>();

            for (var i = 0; i < serializedObject.targetObjects.Length; i++)
            {
                var p = ((PlanarReflectionProbe)serializedObject.targetObjects[i]).proxyVolumeReference;
                if (p != null)
                {
                    objs.Add(p);
                }
            }

            reflectionProxyVolume = objs.Count > 0
                ? new SerializedReflectionProxyVolumeComponent(new SerializedObject(objs.ToArray()))
                : null;
        }