Пример #1
0
 public void CopySHCoefficientArraysFrom(List <SphericalHarmonicsL2> lightProbes)
 {
     if (lightProbes == null)
     {
         throw new ArgumentNullException("lightProbes");
     }
     CopySHCoefficientArraysFrom(NoAllocHelpers.ExtractArrayFromListT(lightProbes), 0, 0, lightProbes.Count);
 }
Пример #2
0
        public static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, List <Matrix4x4> matrices, [uei.DefaultValue("null")] MaterialPropertyBlock properties, [uei.DefaultValue("ShadowCastingMode.On")] ShadowCastingMode castShadows, [uei.DefaultValue("true")] bool receiveShadows, [uei.DefaultValue("0")] int layer, [uei.DefaultValue("null")] Camera camera, [uei.DefaultValue("LightProbeUsage.BlendProbes")] LightProbeUsage lightProbeUsage, [uei.DefaultValue("null")] LightProbeProxyVolume lightProbeProxyVolume)
        {
            if (matrices == null)
            {
                throw new ArgumentNullException("matrices");
            }

            DrawMeshInstanced(mesh, submeshIndex, material, NoAllocHelpers.ExtractArrayFromListT(matrices), matrices.Count, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
        }
Пример #3
0
 public void GetBoneWeights(List <BoneWeight> boneWeights)
 {
     if (boneWeights == null)
     {
         throw new ArgumentNullException("The result boneWeights list cannot be null.", "boneWeights");
     }
     NoAllocHelpers.EnsureListElemCount <BoneWeight>(boneWeights, this.GetBoneWeightCount());
     this.GetBoneWeightsNonAllocImpl(NoAllocHelpers.ExtractArrayFromListT <BoneWeight>(boneWeights));
 }
Пример #4
0
 public void GetBindposes(List <Matrix4x4> bindposes)
 {
     if (bindposes == null)
     {
         throw new ArgumentNullException("The result bindposes list cannot be null.", "bindposes");
     }
     NoAllocHelpers.EnsureListElemCount <Matrix4x4>(bindposes, this.GetBindposeCount());
     this.GetBindposesNonAllocImpl(NoAllocHelpers.ExtractArrayFromListT <Matrix4x4>(bindposes));
 }
Пример #5
0
        public void CopyProbeOcclusionArrayFrom(List <Vector4> occlusionProbes)
        {
            bool flag = occlusionProbes == null;

            if (flag)
            {
                throw new ArgumentNullException("occlusionProbes");
            }
            this.CopyProbeOcclusionArrayFrom(NoAllocHelpers.ExtractArrayFromListT <Vector4>(occlusionProbes), 0, 0, occlusionProbes.Count);
        }
Пример #6
0
        public void GetSharedMaterials(List <Material> m)
        {
            bool flag = m == null;

            if (flag)
            {
                throw new ArgumentNullException("The result material list cannot be null.", "m");
            }
            NoAllocHelpers.EnsureListElemCount <Material>(m, this.GetMaterialCount());
            this.CopySharedMaterialArray(NoAllocHelpers.ExtractArrayFromListT <Material>(m));
        }
Пример #7
0
 public void GetIndices(List <int> indices, int submesh, [UnityEngine.Internal.DefaultValue("true")] bool applyBaseVertex)
 {
     if (indices == null)
     {
         throw new ArgumentNullException("The result indices list cannot be null.", "indices");
     }
     if (submesh < 0 || submesh >= this.subMeshCount)
     {
         throw new IndexOutOfRangeException("Specified sub mesh is out of range. Must be greater or equal to 0 and less than subMeshCount.");
     }
     NoAllocHelpers.EnsureListElemCount <int>(indices, (int)this.GetIndexCount(submesh));
     this.GetIndicesNonAllocImpl(NoAllocHelpers.ExtractArrayFromListT <int>(indices), submesh, applyBaseVertex);
 }
Пример #8
0
        public void GetBoneWeights(List <BoneWeight> boneWeights)
        {
            if (boneWeights == null)
            {
                throw new ArgumentNullException("The result boneWeights list cannot be null.", "boneWeights");
            }

            if (HasBoneWeights())
            {
                NoAllocHelpers.EnsureListElemCount(boneWeights, vertexCount);
            }
            GetBoneWeightsNonAllocImpl(NoAllocHelpers.ExtractArrayFromListT(boneWeights));
        }
Пример #9
0
        public void GetIndices(List <ushort> indices, int submesh, bool applyBaseVertex = true)
        {
            if (indices == null)
            {
                throw new ArgumentNullException("The result indices list cannot be null.", nameof(indices));
            }

            if (submesh < 0 || submesh >= subMeshCount)
            {
                throw new IndexOutOfRangeException("Specified sub mesh is out of range. Must be greater or equal to 0 and less than subMeshCount.");
            }

            NoAllocHelpers.EnsureListElemCount(indices, (int)GetIndexCount(submesh));
            GetIndicesNonAllocImpl16(NoAllocHelpers.ExtractArrayFromListT(indices), submesh, applyBaseVertex);
        }
Пример #10
0
        public void GetTriangles(List <int> triangles, int submesh, [DefaultValue("true")] bool applyBaseVertex)
        {
            if (triangles == null)
            {
                throw new ArgumentNullException("The result triangles list cannot be null.", "triangles");
            }

            if (submesh < 0 || submesh >= subMeshCount)
            {
                throw new IndexOutOfRangeException("Specified sub mesh is out of range. Must be greater or equal to 0 and less than subMeshCount.");
            }

            NoAllocHelpers.EnsureListElemCount(triangles, 3 * (int)GetTrianglesCountImpl(submesh));
            GetTrianglesNonAllocImpl(NoAllocHelpers.ExtractArrayFromListT(triangles), submesh, applyBaseVertex);
        }
Пример #11
0
        public static void CalculateInterpolatedLightAndOcclusionProbes(List <Vector3> positions, List <SphericalHarmonicsL2> lightProbes, List <Vector4> occlusionProbes)
        {
            bool flag = positions == null;

            if (flag)
            {
                throw new ArgumentNullException("positions");
            }
            bool flag2 = lightProbes == null && occlusionProbes == null;

            if (flag2)
            {
                throw new ArgumentException("Argument lightProbes and occlusionProbes cannot both be null.");
            }
            bool flag3 = lightProbes != null;

            if (flag3)
            {
                bool flag4 = lightProbes.Capacity < positions.Count;
                if (flag4)
                {
                    lightProbes.Capacity = positions.Count;
                }
                bool flag5 = lightProbes.Count < positions.Count;
                if (flag5)
                {
                    NoAllocHelpers.ResizeList <SphericalHarmonicsL2>(lightProbes, positions.Count);
                }
            }
            bool flag6 = occlusionProbes != null;

            if (flag6)
            {
                bool flag7 = occlusionProbes.Capacity < positions.Count;
                if (flag7)
                {
                    occlusionProbes.Capacity = positions.Count;
                }
                bool flag8 = occlusionProbes.Count < positions.Count;
                if (flag8)
                {
                    NoAllocHelpers.ResizeList <Vector4>(occlusionProbes, positions.Count);
                }
            }
            LightProbes.CalculateInterpolatedLightAndOcclusionProbes_Internal(NoAllocHelpers.ExtractArrayFromListT <Vector3>(positions), positions.Count, NoAllocHelpers.ExtractArrayFromListT <SphericalHarmonicsL2>(lightProbes), NoAllocHelpers.ExtractArrayFromListT <Vector4>(occlusionProbes));
        }
Пример #12
0
        public void GetMaterials(List <Material> m)
        {
            bool flag = m == null;

            if (flag)
            {
                throw new ArgumentNullException("The result material list cannot be null.", "m");
            }
            bool flag2 = this.IsPersistent();

            if (flag2)
            {
                throw new InvalidOperationException("Not allowed to access Renderer.materials on prefab object. Use Renderer.sharedMaterials instead");
            }
            NoAllocHelpers.EnsureListElemCount <Material>(m, this.GetMaterialCount());
            this.CopyMaterialArray(NoAllocHelpers.ExtractArrayFromListT <Material>(m));
        }
Пример #13
0
        public static bool GenerateAtlas(Vector2[] sizes, int padding, int atlasSize, List <Rect> results)
        {
            bool flag = sizes == null;

            if (flag)
            {
                throw new ArgumentException("sizes array can not be null");
            }
            bool flag2 = results == null;

            if (flag2)
            {
                throw new ArgumentException("results list cannot be null");
            }
            bool flag3 = padding < 0;

            if (flag3)
            {
                throw new ArgumentException("padding can not be negative");
            }
            bool flag4 = atlasSize <= 0;

            if (flag4)
            {
                throw new ArgumentException("atlas size must be positive");
            }
            results.Clear();
            bool flag5 = sizes.Length == 0;
            bool result;

            if (flag5)
            {
                result = true;
            }
            else
            {
                NoAllocHelpers.EnsureListElemCount <Rect>(results, sizes.Length);
                Texture2D.GenerateAtlasImpl(sizes, padding, atlasSize, NoAllocHelpers.ExtractArrayFromListT <Rect>(results));
                result = (results.Count != 0);
            }
            return(result);
        }
Пример #14
0
        public static void CalculateInterpolatedLightAndOcclusionProbes(List <Vector3> positions, List <SphericalHarmonicsL2> lightProbes, List <Vector4> occlusionProbes)
        {
            if (positions == null)
            {
                throw new ArgumentNullException("positions");
            }
            else if (lightProbes == null && occlusionProbes == null)
            {
                throw new ArgumentException("Argument lightProbes and occlusionProbes cannot both be null.");
            }

            if (lightProbes != null)
            {
                if (lightProbes.Capacity < positions.Count)
                {
                    lightProbes.Capacity = positions.Count;
                }
                if (lightProbes.Count < positions.Count)
                {
                    NoAllocHelpers.ResizeList(lightProbes, positions.Count);
                }
            }

            if (occlusionProbes != null)
            {
                if (occlusionProbes.Capacity < positions.Count)
                {
                    occlusionProbes.Capacity = positions.Count;
                }
                if (occlusionProbes.Count < positions.Count)
                {
                    NoAllocHelpers.ResizeList(occlusionProbes, positions.Count);
                }
            }

            CalculateInterpolatedLightAndOcclusionProbes_Internal(NoAllocHelpers.ExtractArrayFromListT(positions), positions.Count, NoAllocHelpers.ExtractArrayFromListT(lightProbes), NoAllocHelpers.ExtractArrayFromListT(occlusionProbes));
        }
Пример #15
0
 public static void SetGlobalFloatArray(int name, List <float> values)
 {
     Shader.SetGlobalFloatArray(name, NoAllocHelpers.ExtractArrayFromListT <float>(values), values.Count);
 }
Пример #16
0
 public void SetMatrixArray(string name, List <Matrix4x4> values)
 {
     this.SetMatrixArray(Shader.PropertyToID(name), NoAllocHelpers.ExtractArrayFromListT <Matrix4x4>(values), values.Count);
 }
Пример #17
0
 public void SetFloatArray(string name, List <float> values)
 {
     this.SetFloatArray(Shader.PropertyToID(name), NoAllocHelpers.ExtractArrayFromListT <float>(values), values.Count);
 }
Пример #18
0
 public void SetColorArray(int name, List <Color> values)
 {
     this.SetColorArray(name, NoAllocHelpers.ExtractArrayFromListT <Color>(values), values.Count);
 }
Пример #19
0
 public static void SetGlobalMatrixArray(string name, List <Matrix4x4> values)
 {
     SetGlobalMatrixArray(Shader.PropertyToID(name), NoAllocHelpers.ExtractArrayFromListT(values), values.Count);
 }
Пример #20
0
 public static void SetGlobalMatrixArray(int nameID, List <Matrix4x4> values)
 {
     SetGlobalMatrixArray(nameID, NoAllocHelpers.ExtractArrayFromListT(values), values.Count);
 }
Пример #21
0
 public void SetFloatArray(int name, List <float> values)
 {
     this.SetFloatArray(name, NoAllocHelpers.ExtractArrayFromListT <float>(values), values.Count);
 }
Пример #22
0
 public static void SetGlobalVectorArray(int nameID, List <Vector4> values)
 {
     SetGlobalVectorArray(nameID, NoAllocHelpers.ExtractArrayFromListT(values), values.Count);
 }
Пример #23
0
 public void SetColorArray(int nameID, List <Color> values)
 {
     SetColorArray(nameID, NoAllocHelpers.ExtractArrayFromListT(values), values.Count);
 }
Пример #24
0
 public void SetVectorArray(string name, List <Vector4> values)
 {
     SetVectorArray(Shader.PropertyToID(name), NoAllocHelpers.ExtractArrayFromListT(values), values.Count);
 }
Пример #25
0
 public void SetFloatArray(int nameID, List <float> values)
 {
     SetFloatArray(nameID, NoAllocHelpers.ExtractArrayFromListT(values), values.Count);
 }
Пример #26
0
 public void CopyProbeOcclusionArrayFrom(List <Vector4> occlusionProbes, int sourceStart, int destStart, int count)
 {
     this.CopyProbeOcclusionArrayFrom(NoAllocHelpers.ExtractArrayFromListT <Vector4>(occlusionProbes), sourceStart, destStart, count);
 }
Пример #27
0
 public void CopySHCoefficientArraysFrom(List <SphericalHarmonicsL2> lightProbes, int sourceStart, int destStart, int count)
 {
     this.CopySHCoefficientArraysFrom(NoAllocHelpers.ExtractArrayFromListT <SphericalHarmonicsL2>(lightProbes), sourceStart, destStart, count);
 }
Пример #28
0
 public void SetMatrixArray(int name, List <Matrix4x4> values)
 {
     this.SetMatrixArray(name, NoAllocHelpers.ExtractArrayFromListT <Matrix4x4>(values), values.Count);
 }
Пример #29
0
 public void SetVectorArray(int name, List <Vector4> values)
 {
     this.SetVectorArray(name, NoAllocHelpers.ExtractArrayFromListT <Vector4>(values), values.Count);
 }