Ejemplo n.º 1
0
 static int GetHashCode(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.Color obj = (UnityEngine.Color)ToLua.CheckObject(L, 1, typeof(UnityEngine.Color));
         int o = obj.GetHashCode();
         LuaDLL.lua_pushinteger(L, o);
         ToLua.SetBack(L, 1, obj);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static bool Color_GetHashCode(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 0)
        {
            UnityEngine.Color argThis = (UnityEngine.Color)vc.csObj;                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(argThis.GetHashCode()));
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
Ejemplo n.º 3
0
 public Texture2D GetTexture(Color color)
 {
     int hashCode = color.GetHashCode() ^ GetType().GetHashCode();
     Texture2D texture;
     if (!iconDatabase.TryGetValue(hashCode, out texture))
     {
         texture = LoadTexture(color);
         iconDatabase.Add(hashCode, texture);
     }
     return texture;
 }