-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed calc material hash #5615
fixed calc material hash #5615
Conversation
hashData += prop._id + ';'; | ||
} | ||
else { | ||
hashData += prop.toString() + ';'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是之前hash的计算过程导致的实例化之后还识别为同个材质么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的
hashData += prop._id + ';'; | ||
} | ||
else { | ||
hashData += prop.toString() + ';'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果是对象的话,所有对象进行 toString 的结果都是字符串 “object”,这个要注意一下,我看之前的 PARAM_MAT4 好像就是对象,还有其他情况是使用对象的吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有对象了,在解析的时候会全部转换为 ArrayBuffer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
} | ||
else { | ||
if (value && typeof value === 'object') { | ||
cc.warn(`Set effect property ${this._name} warning : should transform object to ArrayBuffer`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
防止漏处理的对象,加个 warning
Re: cocos-creator/2d-tasks#2000
Changes: