예제 #1
0
        public static bool GetDefaultVector(SelectionGroup group, PropertyChange p, out Vector4 vector)
        {
            var renderers = SelectionGroupUtility.GetComponents <Renderer>(group.name);

            foreach (var r in renderers)
            {
                if (Match(p.memberNameQuery, r.name))
                {
                    vector = r.sharedMaterials[p.materialIndex].GetVector(p.propertyName);
                    return(true);
                }
            }
            vector = Vector4.zero;
            return(false);
        }
예제 #2
0
        public static bool GetDefaultFloat(SelectionGroup group, PropertyChange p, out float value)
        {
            var renderers = SelectionGroupUtility.GetComponents <Renderer>(group.name);

            foreach (var r in renderers)
            {
                if (Match(p.memberNameQuery, r.name))
                {
                    value = r.sharedMaterials[p.materialIndex].GetFloat(p.propertyName);
                    return(true);
                }
            }
            value = 0;
            return(false);
        }