{"id":4714,"date":"2014-09-22T11:43:00","date_gmt":"2014-09-22T10:43:00","guid":{"rendered":"http:\/\/www.keris-studio.fr\/blog\/?p=4714"},"modified":"2014-11-29T14:35:24","modified_gmt":"2014-11-29T13:35:24","slug":"unity-3d-changer-textures","status":"publish","type":"post","link":"https:\/\/www.keris-studio.fr\/blog\/?p=4714","title":{"rendered":"Unity 3D &ndash; Changer Textures"},"content":{"rendered":"<p>Pr\u00e9parer plusieurs textures<\/p>\n<p><a href=\"https:\/\/www.keris-studio.fr\/blog\/wp-content\/clip_image001.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image001\" src=\"https:\/\/www.keris-studio.fr\/blog\/wp-content\/clip_image001_thumb.png\" alt=\"clip_image001\" width=\"101\" height=\"85\" border=\"0\" \/><\/a><\/p>\n<h4>Script Java<\/h4>\n<pre lang=\"languagestring\">\r\nvar matArray : Material[];\r\n\r\nvar object : GameObject;\r\n\r\nprivate var index : int;\r\n\r\nfunction OnMouseDown(){\r\n\r\nindex++;\r\n\r\nindex = index % matArray.Length;\r\n\r\nrenderer.material = matArray[index];\r\n\r\n}\r\n<\/pre>\n<p><!--more--><\/p>\n<p>Mise en place du script, renseignement des variables.<\/p>\n<p><a href=\"https:\/\/www.keris-studio.fr\/blog\/wp-content\/clip_image002.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image002\" src=\"https:\/\/www.keris-studio.fr\/blog\/wp-content\/clip_image002_thumb.png\" alt=\"clip_image002\" width=\"383\" height=\"137\" border=\"0\" \/><\/a><\/p>\n<p>Op\u00e9ration sur le cube voulu.<\/p>\n<p><a href=\"https:\/\/www.keris-studio.fr\/blog\/wp-content\/clip_image00415.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"clip_image004\" src=\"https:\/\/www.keris-studio.fr\/blog\/wp-content\/clip_image004_thumb15.jpg\" alt=\"clip_image004\" width=\"605\" height=\"160\" border=\"0\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pr\u00e9parer plusieurs textures Script Java var matArray : Material[]; var object : GameObject; private var index : int; function OnMouseDown(){ index++; index = index % matArray.Length; renderer.material = matArray[index]; }<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,8,205],"tags":[140],"class_list":["post-4714","post","type-post","status-publish","format-standard","hentry","category-3d","category-methodologie","category-unity-2","tag-unity"],"_links":{"self":[{"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4714"}],"version-history":[{"count":6,"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4714\/revisions"}],"predecessor-version":[{"id":6587,"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4714\/revisions\/6587"}],"wp:attachment":[{"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.keris-studio.fr\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}