UnityEngine.Material.SetColorArray C# (CSharp) Method

SetColorArray() public method

Set a color array property.

public SetColorArray ( int nameID, Color values ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
values Color Array of values to set.
return void
        public void SetColorArray(int nameID, Color[] values)
        {
            if (values == null)
            {
                throw new ArgumentNullException("values");
            }
            if (values.Length == 0)
            {
                throw new ArgumentException("Zero-sized array is not allowed.");
            }
            this.SetColorArrayImpl(nameID, values);
        }

Same methods

Material::SetColorArray ( int nameID, List values ) : void
Material::SetColorArray ( string name, Color values ) : void
Material::SetColorArray ( string name, List values ) : void

Usage Example

コード例 #1
0
    static int SetColorArray(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 3 && TypeChecker.CheckTypes <int, UnityEngine.Color[]>(L, 2))
            {
                UnityEngine.Material obj = (UnityEngine.Material)ToLua.CheckObject <UnityEngine.Material>(L, 1);
                int arg0 = (int)LuaDLL.lua_tonumber(L, 2);
                UnityEngine.Color[] arg1 = ToLua.ToStructArray <UnityEngine.Color>(L, 3);
                obj.SetColorArray(arg0, arg1);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes <string, UnityEngine.Color[]>(L, 2))
            {
                UnityEngine.Material obj = (UnityEngine.Material)ToLua.CheckObject <UnityEngine.Material>(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                UnityEngine.Color[] arg1 = ToLua.ToStructArray <UnityEngine.Color>(L, 3);
                obj.SetColorArray(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Material.SetColorArray"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
All Usage Examples Of UnityEngine.Material::SetColorArray