Tanoda
MaterialUtil.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using System.Collections.Generic;
10using UnityEngine;
11
13
14 public static class MaterialUtil {
15
16 public static void SetFloatArraySafe(this Material material, string property, List<float> list) {
17 if (list.Count == 0) return;
18 material.SetFloatArray(property, list);
19 }
20
21 public static void SetVectorArraySafe(this Material material, string property, List<Vector4> list) {
22 if (list.Count == 0) return;
23 material.SetVectorArray(property, list);
24 }
25
26 public static void SetColorArraySafe(this Material material, string property, List<Color> list) {
27 if (list.Count == 0) return;
28 material.SetColorArray(property, list);
29 }
30
31 public static void SetMatrixArraySafe(this Material material, string property, List<Matrix4x4> list) {
32 if (list.Count == 0) return;
33 material.SetMatrixArray(property, list);
34 }
35 }
36}