<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1836936334136210687</id><updated>2024-09-28T07:56:28.114+08:00</updated><category term="Android"/><category term="OpenGL"/><category term="Unity3D"/><category term="Ruby on Rails"/><category term="question"/><category term="Android Studio"/><category term="cocos2d-x"/><category term="Web Service"/><category term="iOS"/><category term="typescript"/><title type='text'>寫不完的程式碼</title><subtitle type='html'>一些程式技術的閒談</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>60</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-8795756799621203965</id><published>2020-03-18T21:00:00.002+08:00</published><updated>2020-03-18T21:07:34.511+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="typescript"/><title type='text'>typescript 高階函數</title><content type='html'>&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
寫了一陣子typescript,碰到以下類似的問題，都習慣跑2層for迴圈解掉，&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
不過明明有好用的函數可用，這邊就簡單的練習一下，並記錄下來。&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
依某條件建立新的陣列&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
let c1 = [1,2,3,4,5,6,7,8,9];&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
let c2 = c1.filter(c=&amp;gt; c &amp;gt; 5 &amp;amp;&amp;amp; c &amp;lt; 7 )&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;.map(c =&amp;gt; &quot;no&quot;+c );&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
console.log(c2);&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
由一個陣列c1產生一個新的陣列c2&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
let c1 = [1,2,3,4,5,6,7,8,9];&lt;br /&gt;
let c2 = c1.map(c=&amp;gt; &quot;no&quot;+c);&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
console.log(c2);&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; min-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
用一個陣列c2刪除另一個陣列c1&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
let c1 = [1,2,3,4,5,6,7,8,9];&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
let c2 = [5,8];&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
c1 = c1.filter(c =&amp;gt; !c2.some(value=&amp;gt; c === value ) );&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;
console.log(c1);&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/8795756799621203965/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2020/03/typescript.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/8795756799621203965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/8795756799621203965'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2020/03/typescript.html' title='typescript 高階函數'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-227850683328220642</id><published>2019-06-08T22:16:00.000+08:00</published><updated>2019-06-08T22:16:33.919+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Unity3D"/><title type='text'>[敬請配合]：在 2019 年 8 月 1 日前為應用程式建立 64 位元版本    (for unity3d)</title><content type='html'>收到了google寄來的訊息，明明沒有要更新，但又要對app改版了。 &lt;br /&gt;&lt;br /&gt;這次的重點：AndroidManifest.xml沒照說明填入meta-data &lt;br /&gt;的部份，可是一進遊戲就會跳出的. &lt;br /&gt;&lt;a href=&quot;https://developers.google.com/admob/unity/start&quot;&gt;https://developers.google.com/admob/unity/start&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;版本： &lt;br /&gt;Unity3d 2018 2.2.f1&lt;br /&gt;&lt;br /&gt;下載: &lt;br /&gt;android-ndk-r13b &lt;br /&gt;&lt;a href=&quot;https://developer.android.com/ndk/downloads/older_releases.html&quot;&gt;https://developer.android.com/ndk/downloads/older_releases.html&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;div&gt;
admob v3.17 &lt;br /&gt;&lt;a href=&quot;https://github.com/googleads/googleads-mobile-unity/releases/tag/3.17.0&quot;&gt;https://github.com/googleads/googleads-mobile-unity/releases/tag/3.17.0&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;google play service 0.9.64 &lt;br /&gt;&lt;a href=&quot;https://github.com/playgameservices/play-games-plugin-for-unity&quot;&gt;https://github.com/playgameservices/play-games-plugin-for-unity&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;然後刪除專案的 &lt;br /&gt;Assets/GoogleMobileAds &lt;br /&gt;Assets/GooglePlayGames &lt;br /&gt;Assets/PlayServicesResolver &lt;br /&gt;&lt;br /&gt;重新導入上面的2個plugin,別忘了unity3d的ndk也要設定為r13b &lt;br /&gt;&lt;br /&gt;這邊有64位說明: &lt;br /&gt;&lt;a href=&quot;https://developer.android.com/distribute/best-practices/develop/64-bit&quot;&gt;https://developer.android.com/distribute/best-practices/develop/64-bit&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;這次有點順利，還真不習慣啊。&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/227850683328220642/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2019/06/2019-8-1-64-for-unity3d.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/227850683328220642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/227850683328220642'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2019/06/2019-8-1-64-for-unity3d.html' title='[敬請配合]：在 2019 年 8 月 1 日前為應用程式建立 64 位元版本    (for unity3d)'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-8516278684011854468</id><published>2018-11-27T09:02:00.000+08:00</published><updated>2018-11-27T09:02:53.033+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><title type='text'>cocos creator 1.9 EditBox 在Android功能不正常</title><content type='html'>在Android下,若打開輸入法的顯示字詞建議，EditBox，會有取不到文字的情況。&lt;br /&gt;
應急解法如下：&lt;br /&gt;
cocos2d-x-lite/cocos/platform/android/java/src/org/cocos2dx/lib/&lt;br /&gt;
下的Cocos2dxEditBox.java&lt;br /&gt;
&lt;br /&gt;
找到&lt;br /&gt;
public void setInputMode(int inputMode)&lt;br /&gt;
&lt;br /&gt;
在 this.setInputType這句之前&lt;br /&gt;
&lt;br /&gt;
加上&lt;br /&gt;
this.mInputModeConstraints |= InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;&lt;br /&gt;
把顯示字詞建議關閉即可。</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/8516278684011854468/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2018/11/cocos-creator-19-editbox-android.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/8516278684011854468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/8516278684011854468'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2018/11/cocos-creator-19-editbox-android.html' title='cocos creator 1.9 EditBox 在Android功能不正常'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-6319332557087342851</id><published>2018-08-19T19:45:00.000+08:00</published><updated>2018-08-19T19:45:54.604+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="question"/><title type='text'>HandleRewardBasedVideoFailedToLoad event received with message: no Fill</title><content type='html'>雖然也是收不到google獎勵廣告的問題，但有這次有點不太一樣。&lt;br /&gt;
功能一直都是正常的，只是突然某一天手機會一直收不到，只會吐標題的訊息。&lt;br /&gt;
還好還有別台android設備，試了一下是沒問題的。&lt;br /&gt;
&lt;br /&gt;
猜是google play service又更新的關係吧，用了之前用過的方式：&lt;br /&gt;
&lt;br /&gt;
http://chadgod.blogspot.com/2016/09/unity3d-no-resource-found-that-matches.html&lt;br /&gt;
&lt;br /&gt;
手機上的設定-&amp;gt;應用程式-&amp;gt;Google Play 服務-&amp;gt;管理空間-&amp;gt;清除所有資料&lt;br /&gt;
&lt;br /&gt;
這樣就可以了。&lt;br /&gt;
&lt;br /&gt;
這和一般的no Fill錯誤不太一樣，有可能是因為手機上有開發帳號，再加上google play service新舊版本交替的關係吧。</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/6319332557087342851/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2018/08/handlerewardbasedvideofailedtoload.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/6319332557087342851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/6319332557087342851'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2018/08/handlerewardbasedvideofailedtoload.html' title='HandleRewardBasedVideoFailedToLoad event received with message: no Fill'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-6423663850970189485</id><published>2018-08-12T12:02:00.000+08:00</published><updated>2018-08-12T12:02:29.911+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Unity3D"/><title type='text'>Unity3D 2018 2.2.f1 + google play service + admob</title><content type='html'>照慣例，版本一換就要花些時間重試了：&lt;br /&gt;
&lt;br /&gt;
mac下的安裝&lt;br /&gt;
&lt;br /&gt;
Unity3D 版本&amp;nbsp;2018.2.2.f1&lt;br /&gt;
&lt;br /&gt;
play-games-plugin-for-unity 版本 0.9.50&lt;br /&gt;
https://github.com/playgameservices/play-games-plugin-for-unity&lt;br /&gt;
&lt;br /&gt;
Google Mobile Ads Unity Plugin 版本 v3.15.0&lt;br /&gt;
https://github.com/googleads/googleads-mobile-unity/releases/tag/v3.15.0&lt;br /&gt;
&lt;br /&gt;
External Tools 的Android設定：&lt;br /&gt;
android sdk 需要 8.0&lt;br /&gt;
&lt;br /&gt;
jdk 需要 1.8.1，安裝位置可能有些不同，但可以參考如下：&lt;br /&gt;
/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home&lt;br /&gt;
&lt;br /&gt;
ndk 是用 r10e&lt;br /&gt;
要用IL2CPP就依它建議r13b&lt;br /&gt;
&lt;br /&gt;
設定的地方也有下載鈕，就不列出下載處了。&lt;br /&gt;
&lt;br /&gt;
然後啟動後就崩潰了。&lt;br /&gt;
&lt;br /&gt;
試了以下2種方法選一種就可以解決了。&lt;br /&gt;
&lt;span style=&quot;color: #24292e; font-family: -apple-system, system-ui, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;1. Build System 改為 internal&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #24292e; font-family: -apple-system, system-ui, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;2. Assets/GooglePlayGames/Plugins/Android/GooglePlayGameManifest.plugin/AndroidMainfest.xml&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #24292e; font-family: -apple-system, system-ui, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; 裡面的android:value=\ 3498522668 改成&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #24292e; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 14px;&quot;&gt;android:value=\u0033498522668&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #24292e; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; 主要就是 \ 改為 \u003&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
這裡有解法&lt;br /&gt;
https://github.com/playgameservices/play-games-plugin-for-unity/issues/2254&lt;br /&gt;
&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #ff4647; background-color: #000000}
span.s1 {color: #4f6c87}
span.s2 {color: #de38a5}
&lt;/style&gt;</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/6423663850970189485/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2018/08/unity3d-2018-22f1-google-play-service.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/6423663850970189485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/6423663850970189485'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2018/08/unity3d-2018-22f1-google-play-service.html' title='Unity3D 2018 2.2.f1 + google play service + admob'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-3784984716222927876</id><published>2018-06-08T14:43:00.001+08:00</published><updated>2018-06-08T14:44:39.242+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cocos2d-x"/><title type='text'>cocos compile -p web -m release出現的WindowsError: [Error 2]</title><content type='html'>&lt;br /&gt;&lt;br /&gt;一般在重新建立cocos2d-js的開發環境時會碰到,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;因為以為只發怖web平台的功能.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;所以執行cocos的setup.py時,就會跳過&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;NDK_ROOT,ANDROID_SDK_ROOT,ANT_ROOT這3個參數不去設定.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;等到要產生release時,就出錯,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;將這3個參數設定好就ok了.</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/3784984716222927876/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2018/06/cocos-compile-p-web-m.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/3784984716222927876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/3784984716222927876'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2018/06/cocos-compile-p-web-m.html' title='cocos compile -p web -m release出現的WindowsError: [Error 2]'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-2630341770554620733</id><published>2018-04-24T18:12:00.002+08:00</published><updated>2018-04-24T18:14:54.253+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="question"/><title type='text'>pure-ftp 553 Can&#39;t open that file: Permission denied</title><content type='html'>在mac環境下安裝ubuntu的虛擬機後，ubuntu再裝上docker。&lt;br /&gt;
docker上安裝好pure-ftp後，用FileZilla ftp登入，上傳mac檔案到虛擬機時碰到了如下錯誤:&lt;br /&gt;
553 Can&#39;t open that file: Permission denied&lt;br /&gt;
&lt;br /&gt;
最好把ubuntu目錄的擁有者與群組改成和mac檔案上的使用者一樣，&lt;br /&gt;
假設檔案使用者為test，ubuntu的ftp目錄為ftpdir：&lt;br /&gt;
ubuntu下命令 sudo chown test:test ftpdir&lt;br /&gt;
至於docker上的ftp目錄，實測後不需修改。</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/2630341770554620733/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2018/04/pure-ftp-553-cant-open-that-file.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/2630341770554620733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/2630341770554620733'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2018/04/pure-ftp-553-cant-open-that-file.html' title='pure-ftp 553 Can&#39;t open that file: Permission denied'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-4207412251916620488</id><published>2018-03-25T18:21:00.000+08:00</published><updated>2018-03-25T18:24:36.238+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Web Service"/><title type='text'>CodeIgniter在nginx下404錯誤</title><content type='html'>環境( nginx,php是docker版本)&lt;br /&gt;
Ubuntu 16.0.4&lt;br /&gt;
CodeIgniter 3.1.5&lt;br /&gt;
nginx 1.13.9&lt;br /&gt;
php-fpm 5.6.19&lt;br /&gt;
&lt;br /&gt;
先修改nginx容器的&amp;nbsp;/etc/nginx/conf.d/default.conf&lt;br /&gt;&lt;br /&gt;server {&lt;br /&gt;&lt;br /&gt;    listen 80;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     root /var/www/html;&lt;br /&gt;&lt;br /&gt;    index index.html index.htm index.php;&lt;br /&gt;&lt;br /&gt;     server_name localhost;&lt;br /&gt;&lt;br /&gt;     location / {&lt;br /&gt;        #注意這個xxxxxxxxx,若CodeIgniter在web資料夾內的某目錄裡,就需要填入對應的路徑&lt;br /&gt;        #這個可以輸入網址時,不需要index.php&lt;br /&gt;        try_files $uri $uri/ /xxxxxxxxx/index.php;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     location ~ \.php$ {  #這邊也可換成 \.php($|/)&lt;br /&gt;        fastcgi_split_path_info ^(.+\.php)(/.+)$;&lt;br /&gt;        fastcgi_pass php:9000;&lt;br /&gt;        fastcgi_index index.php;&lt;br /&gt;        fastcgi_param PATH_INFO $fastcgi_path_info;&lt;br /&gt;        fastcgi_param SCRIPT_FILENAM $document_root$fastcgi_script_name;&lt;br /&gt;        include fastcgi_params;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;     location ~ /\.ht {&lt;br /&gt;        deny all;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;
再修改CodeIgniter內的application/config/config.php&lt;/div&gt;
&lt;div&gt;
這行&amp;nbsp;$config[&#39;uri_protocol&#39;] = &#39;PATH_INFO&#39;;&lt;/div&gt;
&lt;div&gt;
改成&amp;nbsp;$config[&#39;uri_protocol&#39;] = &#39;REQUEST_URI&#39;;&lt;/div&gt;
&lt;div&gt;
沒改的話都會跑到welcome頁&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
也要填上web的域名,不然form_open會跳到內部ip&lt;/div&gt;
&lt;div&gt;
$config[&#39;base_url&#39;] = &#39;http://xxx.xxx.xxx.xxx:80/&#39;;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/4207412251916620488/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2018/03/codeigniternginx404.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/4207412251916620488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/4207412251916620488'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2018/03/codeigniternginx404.html' title='CodeIgniter在nginx下404錯誤'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-4331111564055687119</id><published>2017-10-04T16:05:00.000+08:00</published><updated>2017-10-04T16:08:27.439+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android Studio"/><title type='text'>Android Studio Plugin入門</title><content type='html'>雖然是寫Android Studio的Plugin，但開發是在IntelliJ IDEA上，&lt;br /&gt;
先到&amp;nbsp; https://www.jetbrains.com/idea/download/&lt;br /&gt;
選擇好自己的作業系統,我是下載Community版。&lt;br /&gt;
&lt;br /&gt;
開始安裝，因為要開發Plugin,左下角的那個插頭圖示需要設為Enable，但沒什麼作用。&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqCIg1Q2tnXFCQBeVYw4EVLmLbPTgnHUoLdrzeYPsFhijMnJovlnnl1O_A3SvfWM5Yllvuu2PGigsyiVTrN6aokQkoU9bvZ5NNkszTV0sdslJpBoP8FmlA87Dxa7BO8hdRR7mQ2CmLZl0/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.03.32.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqCIg1Q2tnXFCQBeVYw4EVLmLbPTgnHUoLdrzeYPsFhijMnJovlnnl1O_A3SvfWM5Yllvuu2PGigsyiVTrN6aokQkoU9bvZ5NNkszTV0sdslJpBoP8FmlA87Dxa7BO8hdRR7mQ2CmLZl0/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.03.32.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
裝好後，隨便new一個專案，然後進入設定，把Plugin裝好。&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhH73vmV9AKbUijcUMwcdiS6ARn6XQUPCTpjt9JX-TfucBYnWq6wAZKW_o5Go4OUL0nh7WRE0Zbn19relg8X0e4fYDueyQrGnrzl9x3mMtwoYZcpWfWY_iJFATgWONjFiya_Pym2W64Bg/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.16.10.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;209&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhH73vmV9AKbUijcUMwcdiS6ARn6XQUPCTpjt9JX-TfucBYnWq6wAZKW_o5Go4OUL0nh7WRE0Zbn19relg8X0e4fYDueyQrGnrzl9x3mMtwoYZcpWfWY_iJFATgWONjFiya_Pym2W64Bg/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.16.10.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
之後IntelliJ IDEA會要求重啟，重啟後new Project就可以找到開發Plugin的項目了。&lt;br /&gt;
&lt;br /&gt;
new好了一個新的Plugin專案後，在src上按右鍵，選擇Action&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi3s2facVT-tIv8Vjs8GPuZAhLthQS2_9iM-EPGYqlBKy-3VYOiLbhTYuVnmRaAlNWD7MC9hcnjGALmnssUJX_YX0yhoZPUnuCiqusrgyTexZaQajr93CVbI4jYsl5CzrofmDO45nTTEU/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.27.51.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;221&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi3s2facVT-tIv8Vjs8GPuZAhLthQS2_9iM-EPGYqlBKy-3VYOiLbhTYuVnmRaAlNWD7MC9hcnjGALmnssUJX_YX0yhoZPUnuCiqusrgyTexZaQajr93CVbI4jYsl5CzrofmDO45nTTEU/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.27.51.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
方便測試，參數都填入一樣的字串plugintest，Groups選ToolsMenu(Tools)，Actions選ToolsBasicGroup(Tools Basic Group)&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjXXqrNVdqFMdw87cUCnDWCuaq9WPDiEKDD8tHBiCz_NlExgzPvMKi7jzMPHh3LYo4fLFp5JZ2Tz15US-2kybNVQ3HxMiu849uIuTP_i6n2QvjdBWFCxEGRnZDNr3SDEihgKLqkxlrhII/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.32.20.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;176&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjXXqrNVdqFMdw87cUCnDWCuaq9WPDiEKDD8tHBiCz_NlExgzPvMKi7jzMPHh3LYo4fLFp5JZ2Tz15US-2kybNVQ3HxMiu849uIuTP_i6n2QvjdBWFCxEGRnZDNr3SDEihgKLqkxlrhII/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.32.20.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
按下OK後，上方會會出現提示，選擇右邊的藍字就好了。&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu6ow55PpMyCreokUc8TKAd3RPMFc57zXOy73RTIT5eZvqP89PmDkPF9C4M-g1PnBoSmUkX9goBVrA1VOrHzK7586TCvEVcbixr7CiVHw0dMVCfXQhWtyGHp45p34P6v6L6AhyLbXrZ_I/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.36.06.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;80&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu6ow55PpMyCreokUc8TKAd3RPMFc57zXOy73RTIT5eZvqP89PmDkPF9C4M-g1PnBoSmUkX9goBVrA1VOrHzK7586TCvEVcbixr7CiVHw0dMVCfXQhWtyGHp45p34P6v6L6AhyLbXrZ_I/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.36.06.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
在plugintest.java的actionPerformed函式加入以下程式碼。&lt;br /&gt;
&lt;pre style=&quot;background-color: #2b2b2b; color: #a9b7c6; font-family: &#39;Menlo&#39;; font-size: 9.0pt;&quot;&gt;Project project = e.getProject()&lt;span style=&quot;color: #cc7832;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #2b2b2b; color: #a9b7c6; font-family: &#39;Menlo&#39;; font-size: 9.0pt;&quot;&gt;Messages.&lt;span style=&quot;font-style: italic;&quot;&gt;showMessageDialog&lt;/span&gt;(project&lt;span style=&quot;color: #cc7832;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;plugintest&quot;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;,&lt;/span&gt;Messages.&lt;span style=&quot;font-style: italic;&quot;&gt;getInformationIcon&lt;/span&gt;())&lt;span style=&quot;color: #cc7832;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
接下來可以先測試一下，按下右上方的箭頭執行。&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw10AlyanabKhxUfclVx4InWL3LeK8pLFba-8dmEY7w3rp9AD2OoUf-BB8hkiURLhH96peW4kj8Y-Z5O46nXYc3n7VetOrwGgD1iOsvTuac9a7CThnKl1TAJkkP25nQOyX_4OE6uOwAyQ/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.53.11.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;102&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw10AlyanabKhxUfclVx4InWL3LeK8pLFba-8dmEY7w3rp9AD2OoUf-BB8hkiURLhH96peW4kj8Y-Z5O46nXYc3n7VetOrwGgD1iOsvTuac9a7CThnKl1TAJkkP25nQOyX_4OE6uOwAyQ/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.53.11.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
會再執行一個IntelliJ IDEA，選擇Tools選項會看到多了一個項目，點擊後會跳出一個對話框，代表成功了。&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd9kU2IHE7VyFKAXxYWwcQDK-wgOXP8sL22R_4f3hqc-oRHQBhxjqxTTQ5sp1Azwf3236nUQiAjnCkgykKtVABOXBLJycZwTNxNg_H53HtLNNss_AF3GD-CrOeSOsxzroKQA5HxHLqn7o/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.54.57.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;168&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd9kU2IHE7VyFKAXxYWwcQDK-wgOXP8sL22R_4f3hqc-oRHQBhxjqxTTQ5sp1Azwf3236nUQiAjnCkgykKtVABOXBLJycZwTNxNg_H53HtLNNss_AF3GD-CrOeSOsxzroKQA5HxHLqn7o/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.54.57.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
在專案上案右鍵選Prepare Plugin Module &#39;plugintest&#39; For Deployment，就可以打包了&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXga4bD1CzEJFHHzIZDwNTdhYTbK8zzhq7Utyke88UVxEmmDKkQUqfudc4bFVGGAQtOU4CNzZ__odhwZXtt-Fyodosg47egK5XKzVQq0dBBO3OQlm89wQ9fSem9VWakSdBNOhsJU7ri2U/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25883.01.43.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXga4bD1CzEJFHHzIZDwNTdhYTbK8zzhq7Utyke88UVxEmmDKkQUqfudc4bFVGGAQtOU4CNzZ__odhwZXtt-Fyodosg47egK5XKzVQq0dBBO3OQlm89wQ9fSem9VWakSdBNOhsJU7ri2U/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25883.01.43.png&quot; width=&quot;317&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
將產生的jar拿給Android Studio安裝會顯示不相容的錯誤。&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQ9IepL9CbJFSiQGxRuWpsFdI_EyDOuyf1_FL4nqAPFrayVfq9litRoj462TgdGBJdNxfefJi8YuiuQkR6lB5GRzR2TpRNiz0hJroZNQ6YoIRCgDnq2jnDlwFu9zefrwUIuZtxCUi3vF8/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25883.09.36.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;102&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQ9IepL9CbJFSiQGxRuWpsFdI_EyDOuyf1_FL4nqAPFrayVfq9litRoj462TgdGBJdNxfefJi8YuiuQkR6lB5GRzR2TpRNiz0hJroZNQ6YoIRCgDnq2jnDlwFu9zefrwUIuZtxCUi3vF8/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25883.09.36.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
回到IntelliJ IDEA在resources-&amp;gt;META-INF-&amp;gt;plugin.xml內&lt;br /&gt;
&lt;pre style=&quot;background-color: #2b2b2b; color: #a9b7c6; font-family: &#39;Menlo&#39;; font-size: 9.0pt;&quot;&gt;&lt;span style=&quot;color: #e8bf6a;&quot;&gt;&amp;lt;idea-version &lt;/span&gt;&lt;span style=&quot;color: #bababa;&quot;&gt;since-build=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;145.0&quot;&lt;/span&gt;&lt;span style=&quot;color: #e8bf6a;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
把這行找出，注意編號的值，需要修改，至於改成多少可以參考一下 其它的Plugin，例如：&lt;br /&gt;
Coverage、Gradle、Properties、Setings Repository等...，我是改成143.0&lt;br /&gt;
&lt;br /&gt;
修改完成後，在Tools下按下plugintest就會跳出對話框了。&lt;br /&gt;
&lt;br /&gt;
以上是Android Studio在2.1.3版的情況，但在2.2.3版按下增加的功能會跳不出對話框 ，還需要回IntelliJ IDEA作些修改。&lt;br /&gt;
&lt;br /&gt;
在src-&amp;gt;plugintest.java內要補上類似package com.my.test;的程式碼，就像在寫android時一樣，名稱自己決定，寫好後也要把plugintest.java移至相同的位置。&lt;br /&gt;
&lt;br /&gt;
別忘了在resources-&amp;gt;META-INF-&amp;gt;plugin.xml內找到&lt;br /&gt;
&lt;pre style=&quot;background-color: #2b2b2b; color: #a9b7c6; font-family: &#39;Menlo&#39;; font-size: 9.0pt;&quot;&gt;&lt;span style=&quot;color: #e8bf6a;&quot;&gt;&amp;lt;action &lt;/span&gt;&lt;span style=&quot;color: #bababa;&quot;&gt;id=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;plugintest&quot; &lt;/span&gt;&lt;span style=&quot;color: #bababa;&quot;&gt;class=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;plugintest&quot; &lt;/span&gt;&lt;span style=&quot;color: #bababa;&quot;&gt;text=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;plugintest&quot; &lt;/span&gt;&lt;span style=&quot;color: #bababa;&quot;&gt;description=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;plugintest&quot;&lt;/span&gt;&lt;span style=&quot;color: #e8bf6a;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
把class的值加上剛才自己定的包名，例如com.my.test.plugintest。這樣2.2.3版就可以顯示對話框了。&lt;br /&gt;
&lt;br /&gt;
另外在plugin.xml內有一行&lt;br /&gt;
&lt;pre style=&quot;background-color: #2b2b2b; color: #a9b7c6; font-family: &#39;Menlo&#39;; font-size: 9.0pt;&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;&amp;lt;depends&amp;gt;com.intellij.modules.lang&amp;lt;/depends&amp;gt;&lt;/span&gt;&lt;/pre&gt;
碰到其它錯誤時，可視需要打開，或修改。</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/4331111564055687119/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2017/10/android-studio-plugin.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/4331111564055687119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/4331111564055687119'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2017/10/android-studio-plugin.html' title='Android Studio Plugin入門'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqCIg1Q2tnXFCQBeVYw4EVLmLbPTgnHUoLdrzeYPsFhijMnJovlnnl1O_A3SvfWM5Yllvuu2PGigsyiVTrN6aokQkoU9bvZ5NNkszTV0sdslJpBoP8FmlA87Dxa7BO8hdRR7mQ2CmLZl0/s72-c/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2017-10-04+%25E4%25B8%258B%25E5%258D%25882.03.32.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-2354145396089795559</id><published>2017-04-06T14:45:00.002+08:00</published><updated>2017-04-06T14:45:24.814+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Unity3D"/><title type='text'>Unity3d 同時使用 google play service 與 admob </title><content type='html'>之前有寫過這2個外掛合用需要做些修改，現在不用了。&lt;br /&gt;
&lt;br /&gt;
Unity3D 的版本 5.3.4f1&lt;br /&gt;
&lt;br /&gt;
play-games-plugin-for-unity 版本 0.9.36&lt;br /&gt;
https://github.com/playgameservices/play-games-plugin-for-unity&lt;br /&gt;
&lt;br /&gt;
Google Mobile Ads Unity Plugin 版本 v3.4.0&lt;br /&gt;
https://github.com/googleads/googleads-mobile-unity/releases/tag/v3.4.0&lt;br /&gt;
&lt;br /&gt;
2個外掛換了最新的版本，主要是想試試獎勵式廣告。&lt;br /&gt;
在admob上設好後，等一段時間再試，才會成功，基本上沒什麼問題，&lt;br /&gt;
要注意的是 google play service 出現2個警告：&lt;br /&gt;
&lt;br /&gt;
Found dependencies: com.android.support:support-v4 required by (this app)&lt;br /&gt;
&lt;br /&gt;
WARNING: No compatible versions of com.android.support:support-v4 required by (com.google.android.gms:play-services-basement:9.4.0), will try using the latest version 23.4.0&lt;br /&gt;
&lt;br /&gt;
但還是可以正常使用登入與遊戲存檔和顯示廣告。&lt;br /&gt;
&lt;br /&gt;
提一下碰到的坑，Android SDK更新如下：（好久沒更新了）&lt;br /&gt;
Android Support Repository 36 -&amp;gt; 47&lt;br /&gt;
Google Play services 32 -&amp;gt; 39&lt;br /&gt;
Google Repository 32 -&amp;gt; 46&lt;br /&gt;
Intel x86 Emulator Accelerator(HAXM installer) 6.0.3 -&amp;gt; 6.1.1&lt;br /&gt;
&lt;br /&gt;
更新後遊戲內登入google就會crash，我猜是Google Play services這個更新的問題，&lt;br /&gt;
所以我先回復成舊版，讓功能正常比較重要。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/2354145396089795559/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2017/04/unity3d-google-play-service-admob.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/2354145396089795559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/2354145396089795559'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2017/04/unity3d-google-play-service-admob.html' title='Unity3d 同時使用 google play service 與 admob '/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-391207525483535327</id><published>2016-09-26T16:16:00.001+08:00</published><updated>2016-09-26T16:16:49.981+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="question"/><title type='text'>Google Domains信用卡無法結帳(You appear to be in a country where Google Domains is not yet available.)</title><content type='html'>之前買的Google Domains服務快到期了，於是再去購買，只是會出現如下的錯誤訊息：&lt;br /&gt;
&lt;div&gt;
Oops! We couldn&#39;t checkout your cart. Please try again later.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
這時才想起來，去年也是卡在這裡，而且還有另一個訊息:&lt;/div&gt;
You appear to be in a country where Google Domains is not yet available.&lt;br /&gt;
&lt;div&gt;
記得只要把地址改一改就行了,於是就去Google Wallet去改信用卡的地址，只是改完後，還是一樣無法結帳。&lt;br /&gt;
後來只好按下這一串You appear to be in a country where Google Domains is not yet available.後方的Learn more，就會顯示一個對話框：&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibXKUyfl18aHtVcxk3Zmk-1zSJaAb6Bg1mfhyphenhyphenkRRaGiXDZDYSAVsMhi7rLDzLy7kDqITdaAngXso5OrLQpgpeYxVFIy5WVbbdFtGMnBb7R6VoSiE7i4_pZtapAzXAm9AY82NPGm1QAdMk/s1600/domane.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;86&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibXKUyfl18aHtVcxk3Zmk-1zSJaAb6Bg1mfhyphenhyphenkRRaGiXDZDYSAVsMhi7rLDzLy7kDqITdaAngXso5OrLQpgpeYxVFIy5WVbbdFtGMnBb7R6VoSiE7i4_pZtapAzXAm9AY82NPGm1QAdMk/s320/domane.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
接著選 Wait, i have a US &amp;nbsp;Billing address.然後就會有個介面跳到改信用卡的地址或增加信用卡，我再增加一張信用卡就可以買了，地址別忘了要美國的地址，奇怪的地方在於增加的信用卡是重復輸入的，改的也是Google Wallet的設定。但自己去Google Wallet改好像沒用。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/391207525483535327/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2016/09/google-domainsyou-appear-to-be-in.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/391207525483535327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/391207525483535327'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2016/09/google-domainsyou-appear-to-be-in.html' title='Google Domains信用卡無法結帳(You appear to be in a country where Google Domains is not yet available.)'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibXKUyfl18aHtVcxk3Zmk-1zSJaAb6Bg1mfhyphenhyphenkRRaGiXDZDYSAVsMhi7rLDzLy7kDqITdaAngXso5OrLQpgpeYxVFIy5WVbbdFtGMnBb7R6VoSiE7i4_pZtapAzXAm9AY82NPGm1QAdMk/s72-c/domane.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-7924037849084985907</id><published>2016-09-10T23:02:00.001+08:00</published><updated>2016-09-10T23:07:49.800+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Unity3D"/><title type='text'>play-games-plugin-for-unity 與 googleads-mobile-unity 混用</title><content type='html'>雖然有人把google play services和admob的Unity3D plugin都寫好了，但同時使用也是要動手微調一下，不然可能就會碰到以下2種錯誤。&lt;br /&gt;
Failed to re-package resources&lt;br /&gt;
&lt;div&gt;
Unable to convert classes into dex format&lt;br /&gt;
先把Unity和plugin的版本列出&lt;br /&gt;
&lt;br /&gt;
Unity3D 5.3&lt;br /&gt;
&lt;br /&gt;
Unity3D的google play services plugin 0.9.34&lt;br /&gt;
https://github.com/playgameservices/play-games-plugin-for-unity&lt;br /&gt;
&lt;br /&gt;
Unity3D的admob plugin 3.0.5&lt;br /&gt;
https://github.com/googleads/googleads-mobile-unity/releases&lt;br /&gt;
&lt;br /&gt;
將2種plugin合起來用需要做些修改，可參考以下網址：&lt;br /&gt;
https://ndesostyle.wordpress.com/2016/02/10/conflict-with-latest-googleads-mobile-and-play-games-plugin-for-unity/&lt;br /&gt;
&lt;br /&gt;
網頁上的重點是這一段字後面的影片連結：&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #373737; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px; line-height: 24.375px;&quot;&gt;Fixing google play games and admob plugin Unity. Video tutorial is Available &amp;nbsp;Youtube&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
可惜裡面用的版本有點舊了，我再把改的過程記錄一下。&lt;br /&gt;
&lt;br /&gt;
1.先裝play-games-plugin-for-unity,若碰到&lt;br /&gt;
Unity3D No resource found that matches the given name (at &#39;value&#39; with value &#39;@integer/google_play_services_version&#39;).&lt;br /&gt;
&lt;div&gt;
錯誤,可先看之前這篇的方法&lt;/div&gt;
&lt;div&gt;
http://chadgod.blogspot.tw/2016/09/unity3d-no-resource-found-that-matches.html&lt;/div&gt;
&lt;div&gt;
沒問題後再把admob plugin裝上&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2.打開Assets/GooglePlayGames/Editor/GPGSUpgrader.cs&lt;/div&gt;
&lt;div&gt;
在97行的地方把以下2行註解掉&lt;/div&gt;
//string clientDir = &quot;Assets/Plugins/Android/google-play-services_lib&quot;;&lt;br /&gt;
//GPGSUtil.DeleteDirIfExists(clientDir);&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
3.打開Assets/GooglePlayGames/Editor/GPGSDependencies.cs&lt;/div&gt;
&lt;div&gt;
在67行的地方註解掉&lt;/div&gt;
//svcSupport.DependOn(&quot;com.android.support&quot;,&lt;br /&gt;
//&quot;support-v4&quot;,&lt;br /&gt;
//&quot;23.1+&quot;);&lt;br /&gt;
&lt;div&gt;
後面加上&lt;/div&gt;
svcSupport.DependOn(&quot;com.google.android.gms&quot;,&lt;br /&gt;
&quot;play-services-ads&quot;,&lt;br /&gt;
PluginVersion.PlayServicesVersionConstraint);&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
4.打開Assets/Plugins/Android/GoogleMobileAdsPlugin/AndroidManifest.xml&lt;/div&gt;
&lt;div&gt;
在23~25行註解掉&lt;/div&gt;
&amp;lt;!--  &amp;lt;activity android:name=&quot;com.google.android.gms.ads.AdActivity&quot;&lt;br /&gt;
android:configChanges=&quot;keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize&quot;&lt;br /&gt;
android:theme=&quot;@android:style/Theme.Translucent&quot; /&amp;gt; --&amp;gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
5.改好後回到Unity3D編輯器會跳出一個對話框內容如下&lt;/div&gt;
&lt;div&gt;
Remove or replace support-v4 version 23.4.0 with version 23.1.1?&lt;/div&gt;
&lt;div&gt;
我選了ok&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
6.這時就可以先Build看看了，若成功就可以到以下網址看Unity的admob範例&lt;/div&gt;
&lt;div&gt;
https://developers.google.com/mobile-ads-sdk/docs/games?hl=zh-tw#unity&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
7.若失敗也只能在找看看有沒有其它方法了，附上使用的android sdk，提供一些線索。&lt;/div&gt;
&lt;div&gt;
Tools&lt;/div&gt;
&lt;div&gt;
Android SDK Tools 25.1.7&lt;/div&gt;
&lt;div&gt;
Android SDK Platform-tools 24.0.2&lt;/div&gt;
&lt;div&gt;
Android SDK Build-tools 23.0.2&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Android 6.0&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Extras&lt;/div&gt;
&lt;div&gt;
Android Support Repository 36&lt;/div&gt;
&lt;div&gt;
Google Play services 32&lt;/div&gt;
&lt;div&gt;
Google Repository 32&lt;/div&gt;
&lt;div&gt;
Google Play APK Expansion library 1&lt;/div&gt;
&lt;div&gt;
Google Play Licensing Library 1&lt;/div&gt;
&lt;div&gt;
Intel x86 Emulator Accelerator(HAXM installer) 6.0.3&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/7924037849084985907/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2016/09/play-games-plugin-for-unity-googleads.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/7924037849084985907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/7924037849084985907'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2016/09/play-games-plugin-for-unity-googleads.html' title='play-games-plugin-for-unity 與 googleads-mobile-unity 混用'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-2733247793747233879</id><published>2016-09-08T14:18:00.000+08:00</published><updated>2016-09-08T14:18:26.741+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Unity3D"/><title type='text'>Unity3D No resource found that matches the given name (at &#39;value&#39; with value &#39;@integer/google_play_services_version&#39;).</title><content type='html'>&lt;br /&gt;
在Unity3D 5.3 加上google play service的功能會先去下載下面的plugin&lt;br /&gt;
https://github.com/playgameservices/play-games-plugin-for-unity&lt;br /&gt;
不意外的，又有如標題的錯誤了.&lt;br /&gt;
&lt;br /&gt;
大部份解法都是去android sdk目錄下的 extras\google\google_play_services 找檔案來用，但我實在是找不到那些神奇的檔案。&lt;br /&gt;
不過下面這個網址倒是有不一樣的解法，可以參考看看&lt;br /&gt;
https://app-c.net/tutorial/unity/version5_2/&lt;br /&gt;
&lt;br /&gt;
他是直接把 @integer/google_play_services_version 這變數換成字串，如下&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: Roboto, &amp;quot;Noto Sans&amp;quot;, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16px; line-height: 24px;&quot;&gt;&amp;lt;meta-data&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: Roboto, &amp;quot;Noto Sans&amp;quot;, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16px; line-height: 24px;&quot;&gt;android:name=&quot;com.google.android.gms.version&quot;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #444444; font-family: Roboto, &amp;quot;Noto Sans&amp;quot;, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16px; line-height: 24px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: Roboto, &amp;quot;Noto Sans&amp;quot;, &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16px; line-height: 24px;&quot;&gt;android:value=&quot;4323000&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
到這裡可以編釋了，過了一段時間回頭看這個值又變回@integer/google_play_services_version了，估計是在&lt;br /&gt;
Window-&amp;gt;GooglePlayGames-&amp;gt;setup-&amp;gt;Android setup...&lt;br /&gt;
的設定完成後就變回去了，所以說不定一開始把這個欄位刪除也可以先編釋。&lt;br /&gt;
&lt;br /&gt;
順便提一下使用EnableSaveGames()碰到的問題：&lt;br /&gt;
在設定PlayGamesClientConfiguration時，有加上EnableSaveGames()，而且&lt;br /&gt;
在google play開發平台上該設定的都有設定，但登入後遊戲就是會跳掉，那麼可參考如下:&lt;br /&gt;
https://developers.google.com/games/services/console/configuring&lt;br /&gt;
其實就是進入手機上的設定-&amp;gt;應用程式-&amp;gt;Google Play 服務-&amp;gt;管理空間-&amp;gt;清除所有資料。&lt;br /&gt;
就沒問題了。害我以為改錯什麼，又浪費了我好幾個小時...&lt;br /&gt;




</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/2733247793747233879/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2016/09/unity3d-no-resource-found-that-matches.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/2733247793747233879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/2733247793747233879'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2016/09/unity3d-no-resource-found-that-matches.html' title='Unity3D No resource found that matches the given name (at &#39;value&#39; with value &#39;@integer/google_play_services_version&#39;).'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-1450982299830552796</id><published>2016-07-29T20:19:00.000+08:00</published><updated>2016-07-29T20:19:39.493+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="question"/><title type='text'>FastCGI 處理序超過設定的活動逾時</title><content type='html'>&amp;nbsp; 這是在查 &quot;IIS 500 內部伺服器錯誤&quot; 時碰到的，雖然解法一狗票，但第一步還是要先把&lt;br /&gt;
IIS設定內的 &quot;錯誤網頁-&amp;gt;編輯功能設定-&amp;gt;本機要求的詳細錯誤及遠端要求的自定錯誤網頁&quot;，&lt;br /&gt;
改選成詳細錯誤。&lt;br /&gt;
&amp;nbsp; 然後就看到標題的錯誤訊息了，那要怎麼設定呢?&lt;br /&gt;
若IIS的設定UI若有fastCgi的項目就可以進去設定了，但我的IIS沒有。&lt;br /&gt;
所以先用記事本打開c:\Window\System32\inetsrv\config\applicationHost.config&lt;br /&gt;
先找到 fastCgi&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;lang-php prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;fastCgi&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;application&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;fullPath&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;C:\PHP5\php-cgi.exe&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/fastCgi&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
後面再加上參數，改成如下:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;lang-php prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;fastCgi&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;application&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;fullPath&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;C:\PHP5\php-cgi.exe&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;idleTimeout&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;900&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;activityTimeout&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;180&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;requestTimeout&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;10000&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;instanceMaxRequests&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;10000&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/fastCgi&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;那些數值可以自行調整，改好後存檔，在命令列執行iisreset重啟IIS後就可以了。</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/1450982299830552796/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2016/07/fastcgi.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/1450982299830552796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/1450982299830552796'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2016/07/fastcgi.html' title='FastCGI 處理序超過設定的活動逾時'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-6054937051238093244</id><published>2016-07-07T20:07:00.001+08:00</published><updated>2016-07-08T22:13:27.920+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Unity3D"/><title type='text'>自定Unity3D選單</title><content type='html'>以下為Unity3D 5.3版。 &lt;br /&gt;
&lt;br /&gt;
在Unity3D內加上自定的選單是很簡單的，以C#為例:&lt;br /&gt;
&lt;br /&gt;
1.選擇 Assets-&amp;gt;Create-&amp;gt;C# Script &lt;br /&gt;
&lt;br /&gt;
2.Script內容改成如下:&lt;br /&gt;
&lt;br /&gt;
using UnityEngine;&lt;br /&gt; using System.Collections;&lt;div&gt;
#if UNITY_EDITOR&lt;br /&gt; using UnityEditor;&lt;/div&gt;
&lt;div&gt;
#ENDIF&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
#if UNITY_EDITOR&lt;br /&gt; [AddComponentMenu(&quot;my menu 1/my menu 2&quot;)]&lt;/div&gt;
&lt;div&gt;
#endif&lt;br /&gt; public class MyMenu : MonoBehaviour {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; #if UNITY_EDITOR&lt;br /&gt;&amp;nbsp; &amp;nbsp; [MenuItem(&quot;my menu 3/ my menu 4&quot;)]&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; #endif&lt;br /&gt;&amp;nbsp; &amp;nbsp; static void mytest(){&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&amp;nbsp; &amp;nbsp; void Start () {&lt;br /&gt;     &lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; void Update () {&lt;br /&gt;     &lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt; }&lt;br /&gt;
&lt;br /&gt;
然後就可以在Component選單看到新的 my menu 1 子項目，&lt;br /&gt;
&lt;br /&gt;
以及新的 my menu 3 選單。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
我做了個實驗，在Assets下建了新的資料夾，然後把Script放進去後，&lt;br /&gt;
&lt;br /&gt;
只剩 my menu 3 項目有出現。&lt;br /&gt;
&lt;br /&gt;
疑?AddComponentMenu這個功能失敗了嗎?不過把Script放回Assets資料夾後，&lt;br /&gt;
&lt;br /&gt;
這個功能又正常了，所以要注意一下放的位置。&lt;span style=&quot;color: #333333; font-family: &amp;quot;menlo&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/6054937051238093244/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2016/07/unity3d.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/6054937051238093244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/6054937051238093244'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2016/07/unity3d.html' title='自定Unity3D選單'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-9221533384585307583</id><published>2016-07-06T13:58:00.001+08:00</published><updated>2016-07-06T13:58:47.477+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><title type='text'>MAC下的android開發環境</title><content type='html'>先下載JDK，在終端機上輸入：&lt;br /&gt;
java -version&lt;br /&gt;
若沒裝JDK會如下顯示&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqd4f81DrEUvMb-PbRjR08CljgVRIylCcYSl51ptCFLHh0yGULMDYdlT4JCRCxypLTOpBSwkljp_l3ovlUAPYSft-QqwjdIT9s__bYKoB8B3ZP_rDQ6r-LmXSbv2e81Rm014A8HvP42DM/s1600/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7+2015-03-15+%E4%B8%8B%E5%8D%883.17.02.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;163&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqd4f81DrEUvMb-PbRjR08CljgVRIylCcYSl51ptCFLHh0yGULMDYdlT4JCRCxypLTOpBSwkljp_l3ovlUAPYSft-QqwjdIT9s__bYKoB8B3ZP_rDQ6r-LmXSbv2e81Rm014A8HvP42DM/s1600/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7+2015-03-15+%E4%B8%8B%E5%8D%883.17.02.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
這時選更多資訊，會到java的官網上，去選擇下載Mac OS X x64版本的JDK&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbStVx6pBRT7KcqWWYvOLIFcEeA4jUycr6jcVOF0xJ6Ax1yHSTIqHCM15uuUqbmtq2Oc9uJh5Wqch_RYEGBsWqj6C70a467dh-Xxt37NNfydSR93nBP9a_9Xb0k52UG8-sJv9pBpUexOE/s1600/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7+2015-03-15+%E4%B8%8B%E5%8D%883.22.56.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbStVx6pBRT7KcqWWYvOLIFcEeA4jUycr6jcVOF0xJ6Ax1yHSTIqHCM15uuUqbmtq2Oc9uJh5Wqch_RYEGBsWqj6C70a467dh-Xxt37NNfydSR93nBP9a_9Xb0k52UG8-sJv9pBpUexOE/s1600/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7+2015-03-15+%E4%B8%8B%E5%8D%883.22.56.png&quot; width=&quot;269&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
下載完成後就是安裝了，裝好了再用java -version確認一下就可以了。&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3y_D93SXmtR9ZKSIBTRMMo8odQCokw6r_PASq0n5Z68DOCQ9vnSvIHrThvcSb5LC-xSTsHr4pYXhMGh6uP7UtFB9QsxdmgxFoL5nMgr3n59rj39qmW7ZPmquiUc5XxufgmBZaYXMgc0Q/s1600/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7+2015-03-15+%E4%B8%8B%E5%8D%883.29.21.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3y_D93SXmtR9ZKSIBTRMMo8odQCokw6r_PASq0n5Z68DOCQ9vnSvIHrThvcSb5LC-xSTsHr4pYXhMGh6uP7UtFB9QsxdmgxFoL5nMgr3n59rj39qmW7ZPmquiUc5XxufgmBZaYXMgc0Q/s1600/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7+2015-03-15+%E4%B8%8B%E5%8D%883.29.21.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
然後到android官網http://developer.android.com/sdk/index.html下載Android Studio，按下綠色按紐即可&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8XfFyvtNx2pug6L2P2WL_NuGvGOWH3ecS_fTZUcqsh3cX8CDRKExn9d5ojNPSTv4n9iyrELtV83DWZb1pkJEsihKALkM_ab_M6YL9v1RPwUx0mvS2yjEfTXW1xBr1ZjmM7dcQB4wePZA/s1600/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7+2015-03-15+%E4%B8%8B%E5%8D%883.39.41.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;202&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8XfFyvtNx2pug6L2P2WL_NuGvGOWH3ecS_fTZUcqsh3cX8CDRKExn9d5ojNPSTv4n9iyrELtV83DWZb1pkJEsihKALkM_ab_M6YL9v1RPwUx0mvS2yjEfTXW1xBr1ZjmM7dcQB4wePZA/s1600/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7+2015-03-15+%E4%B8%8B%E5%8D%883.39.41.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
安裝時沒什麼大問題，這邊我也把Virtual Device給裝上去，下一步也有一些選項，反正我都是全選。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1wfah6uaOtxBnLerL7Kt6WTDRBTV-M9X7x_Lq9vCfaYbAqSXziWBXtMLwu-inubXhraQt3FNXuYmAnKIBEDJJO4xncfNxnLVyxb5v3PM9Wy_2HLBNTIsJTcqcJ22ZvSyv8CtWHLnPpBk/s1600/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7+2015-03-15+%E4%B8%8B%E5%8D%883.50.47.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;249&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1wfah6uaOtxBnLerL7Kt6WTDRBTV-M9X7x_Lq9vCfaYbAqSXziWBXtMLwu-inubXhraQt3FNXuYmAnKIBEDJJO4xncfNxnLVyxb5v3PM9Wy_2HLBNTIsJTcqcJ22ZvSyv8CtWHLnPpBk/s1600/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7+2015-03-15+%E4%B8%8B%E5%8D%883.50.47.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
安裝到一半出現了錯誤訊息：The following SDK component was not installed: sys-img-x86-addon-google_apis-google-21&lt;br /&gt;
，Retry給它按下去讓它再裝下去，直到Finish可以按為止。&lt;br /&gt;
安裝完成後開了一個新專案測試了一下，還算順利，只是接上手機時沒有一下就抓到，要等一下，這樣就可以開發了。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/9221533384585307583/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2016/07/macandroid.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/9221533384585307583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/9221533384585307583'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2016/07/macandroid.html' title='MAC下的android開發環境'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqd4f81DrEUvMb-PbRjR08CljgVRIylCcYSl51ptCFLHh0yGULMDYdlT4JCRCxypLTOpBSwkljp_l3ovlUAPYSft-QqwjdIT9s__bYKoB8B3ZP_rDQ6r-LmXSbv2e81Rm014A8HvP42DM/s72-c/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7+2015-03-15+%E4%B8%8B%E5%8D%883.17.02.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-3227738876940118221</id><published>2016-07-06T13:51:00.000+08:00</published><updated>2016-07-07T20:19:54.000+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Unity3D"/><title type='text'>Unity3D在Mac上開2個專案</title><content type='html'>&amp;nbsp; 想同時在Unity3D開啟2個專案，在Edit-&amp;gt;preference下的&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;simsun&amp;quot; , sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;Show Project Wizard at Startup項目打勾就可以了，不過在5.3版上找不到這個項目，在MAC環境下找到另一種方式。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;simsun&amp;quot; , sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;1.打開終端機&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;simsun&amp;quot; , sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;simsun&amp;quot; , sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;2.cd ~ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 進入使用者目錄&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;simsun&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;simsun&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;3.sudo vi .bash_profile &amp;nbsp; &amp;nbsp; &amp;nbsp;編輯bash_profile(不習慣用vi編輯的可改用別種編輯器)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;simsun&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;simsun&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;4.加入以下2行後存檔(alias 後面的 un 和 mono 可改成自己習慣的名稱)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;tahoma&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;simsun&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;alias un=&quot;/Applications/Unity/Unity.app/Contents/MacOS/Unity -projectPath&quot;&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; alias mono=&#39;open -n /Applications/Unity/MonoDevelop.app&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;5.回到使用者目錄輸入 source .bash_profile&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;以後在終端機下輸入 un 就可以打開另一個專案了&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/3227738876940118221/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2016/07/unity3ddmac2.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/3227738876940118221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/3227738876940118221'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2016/07/unity3ddmac2.html' title='Unity3D在Mac上開2個專案'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-2021714789053023141</id><published>2016-03-24T10:20:00.000+08:00</published><updated>2016-04-08T03:06:50.707+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>申請Apple Developer Program碰到的問題</title><content type='html'>Is awesome!&lt;br /&gt;
申請了Apple Developer Program(以前是叫iOS Developer Program),&lt;br /&gt;
也碰到了這個經典問題：&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;We are unable to activate your Apple Developer Program membership.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
其實申請前也爬了一些文，像是姓名，住址與信用卡不同，或是填了中文資料等，&lt;/div&gt;
&lt;div&gt;
會讓申請很不順利。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
所以我特別注意資料不要填錯，全程使用英文輸入，也收到了購買成功的訊息。&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEBsrajXJTrrW5Ea4e0_zvUR9IDVShiI7GYH0LVsYi7H-lFtJ27TsdjBm_FvGzSNABS7_Lamk2rEX6vYh1caMeWBB0fkQ7mlkP5IXglvAeanLvjfWGLbdyVudjkad-a63cUDUFjg9k5vE/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-03-24+%25E4%25B8%258A%25E5%258D%25889.42.15.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;116&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEBsrajXJTrrW5Ea4e0_zvUR9IDVShiI7GYH0LVsYi7H-lFtJ27TsdjBm_FvGzSNABS7_Lamk2rEX6vYh1caMeWBB0fkQ7mlkP5IXglvAeanLvjfWGLbdyVudjkad-a63cUDUFjg9k5vE/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-03-24+%25E4%25B8%258A%25E5%258D%25889.42.15.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
(疑?跟以前比好像更貴了,不過這不是重點)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
接著就等收啟動信了，但等了一天沒收到。&lt;/div&gt;
&lt;div&gt;
於是登入會員中心後，就發現上面的錯誤訊息了，看時間客服都下班了。&lt;/div&gt;
&lt;div&gt;
明天再打電話去問吧，而且從頭到尾也沒收到&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;啟動的通知&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
雖然很多文章都說留言或寄信沒用，不過我還是先用了線上回報，反應了這個問題。&lt;/div&gt;
&lt;div&gt;
結果隔天就收到信了，大意就是帳號已開通，可以使用。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
反正帳號能用，所以最後連電話也不用打了，希望大家申請時比我順利。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/2021714789053023141/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2016/03/apple-developer-program.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/2021714789053023141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/2021714789053023141'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2016/03/apple-developer-program.html' title='申請Apple Developer Program碰到的問題'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEBsrajXJTrrW5Ea4e0_zvUR9IDVShiI7GYH0LVsYi7H-lFtJ27TsdjBm_FvGzSNABS7_Lamk2rEX6vYh1caMeWBB0fkQ7mlkP5IXglvAeanLvjfWGLbdyVudjkad-a63cUDUFjg9k5vE/s72-c/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-03-24+%25E4%25B8%258A%25E5%258D%25889.42.15.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-7223346934066285448</id><published>2016-03-19T17:38:00.000+08:00</published><updated>2016-03-19T17:44:35.857+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cocos2d-x"/><title type='text'>cocos2d-X接入UnityAds(iOS版)</title><content type='html'>1.去官網註冊，取得廣告的GAME ID,並下載sdk,解壓縮後放好,選framework會用到,&lt;br /&gt;
&lt;br /&gt;
2.在Xcode專案下的General-&amp;gt;Linked Frameworks and Libraries增加以下項目&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white; color: #4a4a4a; line-height: 30px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;CFNetwork.framework&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white; color: #4a4a4a; line-height: 30px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;CoreFoundation.framework&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white; color: #4a4a4a; line-height: 30px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;UnityAds.bundle&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white; color: #4a4a4a; line-height: 30px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;UnityAds.framework&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white; color: #4a4a4a; line-height: 30px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;StoreKit.framework&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white; color: #4a4a4a; line-height: 30px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;AdSupport.framework&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white; color: #4a4a4a; line-height: 30px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;SystemConfiguration.framework&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white; color: #4a4a4a; line-height: 30px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;CoreTelephony.framework&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white; color: #4a4a4a; line-height: 30px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;CoreMedia.framework&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #4a4a4a; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;ヒラギノ角ゴ pron w3&amp;quot; , &amp;quot;hiragino kaku gothic pron&amp;quot; , , &amp;quot;meiryo&amp;quot; , sans-serif; font-size: 16px; line-height: 30px;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjocS0AisUekkpz54awbcHM7jIJW-U-rEvS0Jb9Gz7iC2GLw9jSh0h5zXs8WyLTYNosmuVYdEA4AnJ02TvksHepCrYSipNw4-bHERa9CYILXK8ceQiRLW1sIVeii8vEHvpGrU_JTwGU5Z4/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-03-19+%25E4%25B8%258B%25E5%258D%25885.04.34.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjocS0AisUekkpz54awbcHM7jIJW-U-rEvS0Jb9Gz7iC2GLw9jSh0h5zXs8WyLTYNosmuVYdEA4AnJ02TvksHepCrYSipNw4-bHERa9CYILXK8ceQiRLW1sIVeii8vEHvpGrU_JTwGU5Z4/s400/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-03-19+%25E4%25B8%258B%25E5%258D%25885.04.34.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
3.在Xcode專案下的Build Settings-&amp;gt;Search Paths-&amp;gt;Framework Search Paths&lt;br /&gt;
加上UnityAds.Bundle所在的目錄,不然之後會出現UnityAds/UnityAds.h&#39; file not found&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRhitCu244aoTtVlagvxb_jv37vPcuVheOFxWMdkDacT6hU0nFGwIRZo1B7KSSVHM4QNOqs5oOnOgA84f8ofpRm1WyEjRSHsSA0_ZJpvT-ow2l93KzsGt-Yupxk86BfyBU5oOTDW7UFOU/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-03-19+%25E4%25B8%258A%25E5%258D%258810.45.42.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;52&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRhitCu244aoTtVlagvxb_jv37vPcuVheOFxWMdkDacT6hU0nFGwIRZo1B7KSSVHM4QNOqs5oOnOgA84f8ofpRm1WyEjRSHsSA0_ZJpvT-ow2l93KzsGt-Yupxk86BfyBU5oOTDW7UFOU/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-03-19+%25E4%25B8%258A%25E5%258D%258810.45.42.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
4.修改AppController.h&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;#import &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;lt;UIKit/UIKit.h&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;#import &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;lt;UnityAds/UnityAds.h&amp;gt;//&amp;lt;---新增這行&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;@class&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;RootViewController&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;//注意下面紅色新增的字符&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;@interface&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt; AppController : &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;NSObject&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt; &amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;UIApplicationDelegate,&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;UnityAdsDelegate&lt;/span&gt;&amp;gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;UIWindow&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; *window;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;@property&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;nonatomic&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;readonly&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;RootViewController&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;* viewController;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@end&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
5.修改AppController.mm&lt;br /&gt;
&lt;br /&gt;
先找到下面這幾行：&lt;br /&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;// Use RootViewController manage CCEAGLView&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;_viewController&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; = [[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;RootViewController&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;alloc&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;initWithNibName&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;bundle&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;_viewController&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;wantsFullScreenLayout&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;YES&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;_viewController&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt; = eaglView;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;接著往後加這幾行(注意紅色的數字，替換成自己的廣告&lt;span style=&quot;color: #555555; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 20px;&quot;&gt;Game ID&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;)：&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;font-size: x-small;&quot;&gt;//Unity Ads&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;[[UnityAds sharedInstance] setTestMode:YES];//測試時打開&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;[[UnityAds sharedInstance] setDebugMode:YES];//&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;測試時打開&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; [[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;UnityAds&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;sharedInstance&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;startWithGameId&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;@&quot;&lt;span style=&quot;color: red;&quot;&gt;1234567&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;andViewController&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;_viewController&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;











&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;[[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;UnityAds&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;sharedInstance&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;setDelegate&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
然後在這個檔案找個合適的地方加上這個函式(廣告播完後會到這):&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;font-size: x-small;&quot;&gt;- (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;)unityAdsVideoCompleted:(&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;NSString&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt; *)rewardItemKey skipped:(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;BOOL&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;)skipped&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s4&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;6.增加UnityAdsWrapper.h到專案內(跟&lt;/span&gt;AppController.h放同目錄)&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;font-size: x-small;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; UnityAdsWrapper&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; public&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;bool&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; canShow();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; show();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;












&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;7.&lt;/span&gt;增加UnityAdsWrapper.mm到專案內&lt;span class=&quot;s1&quot;&gt;(跟&lt;/span&gt;UnityAdsWrapper.h放同目錄)&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; #import &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;lt;Foundation/Foundation.h&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; #import &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;lt;UnityAds/UnityAds.h&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; #import &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;UnityAdsWrapper.h&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; bool&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;UnityAdsWrapper&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;::canShow()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt; ([[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;UnityAds&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;sharedInstance&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;canShow&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;] &amp;amp;&amp;amp; [[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;UnityAds&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;sharedInstance&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;canShowAds&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;]) {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; void&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;UnityAdsWrapper&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;::show()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;[[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;UnityAds&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;sharedInstance&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;show&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; void&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;UnityAdsWrapper&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;::hide()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;[[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;UnityAds&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;sharedInstance&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;hide&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;8.然後就可以在模擬器測試了,別忘了加入&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;#include &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;UnityAdsWrapper.h&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; 然後用以下程式碼測試:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; if&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;UnityAdsWrapper&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;canShow&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;())&lt;/span&gt;{&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;UnityAdsWrapper&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;show&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;










&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/7223346934066285448/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2016/03/cocos2d-xunityadsios.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/7223346934066285448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/7223346934066285448'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2016/03/cocos2d-xunityadsios.html' title='cocos2d-X接入UnityAds(iOS版)'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjocS0AisUekkpz54awbcHM7jIJW-U-rEvS0Jb9Gz7iC2GLw9jSh0h5zXs8WyLTYNosmuVYdEA4AnJ02TvksHepCrYSipNw4-bHERa9CYILXK8ceQiRLW1sIVeii8vEHvpGrU_JTwGU5Z4/s72-c/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-03-19+%25E4%25B8%258B%25E5%258D%25885.04.34.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-3282080491290949990</id><published>2016-02-29T14:52:00.001+08:00</published><updated>2016-03-01T00:37:18.056+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android Studio"/><title type='text'>在android studio編譯cocos2d-x</title><content type='html'>雖然在專案目錄下直接下指令cocos compile -p android —android-studio就可以編譯程式，若可在android studio內直接按快速鍵^R立即編譯就更方便了。&lt;br /&gt;
&lt;br /&gt;
安裝的版本:&lt;br /&gt;
cocos v3.10&lt;br /&gt;
android studio 1.5.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
先選擇Run-&amp;gt;Edit Configurations&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIh09MArZcrNW0R8sqZfCjYoSRdiT6MPZidg_B9KamwG7qGkYAgim9R3zaQe3dmgWHeo1mufao94kz-jRehJeXV8GkXbtrccDmYsR_jUr8FU6uvH4zeZScFQa7QG1UnV0OvT6DmuaiRK8/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-02-29+%25E4%25B8%258B%25E5%258D%25882.28.51.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;78&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIh09MArZcrNW0R8sqZfCjYoSRdiT6MPZidg_B9KamwG7qGkYAgim9R3zaQe3dmgWHeo1mufao94kz-jRehJeXV8GkXbtrccDmYsR_jUr8FU6uvH4zeZScFQa7QG1UnV0OvT6DmuaiRK8/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-02-29+%25E4%25B8%258B%25E5%258D%25882.28.51.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
再選擇專案,這裡的範例是mytest4&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpXtCXhZc0PbcWVMoSjDvJ_w5gOzF6HnswLPbpMlsMp8iN8GWinNjOA1DpeD0q3j8TVONENcWwJsx1Lc7tudYJyrB_ikY4RY6D30hqbgU53MhWFMArjifo-7ARFHm-vWyk_NCEA2JUtj4/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-02-29+%25E4%25B8%258B%25E5%258D%25882.32.04.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;276&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpXtCXhZc0PbcWVMoSjDvJ_w5gOzF6HnswLPbpMlsMp8iN8GWinNjOA1DpeD0q3j8TVONENcWwJsx1Lc7tudYJyrB_ikY4RY6D30hqbgU53MhWFMArjifo-7ARFHm-vWyk_NCEA2JUtj4/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-02-29+%25E4%25B8%258B%25E5%258D%25882.32.04.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
同樣的畫面下方注意到Before launch: 這個區塊有個+號，按下去&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEshZxR0W8-c8XDRqwXFpgOl97gRZG334Iz9UhFV3glrVXuoQczQdSldK5GxaCFrBVWYc23zPfQLAg1yy31MhUNkTGllUC8S-P2xcXsdRQ1gCAzbw4MHOT8He2ero6E4NK-LwRLgA6yxI/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-02-29+%25E4%25B8%258B%25E5%258D%25882.34.10.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEshZxR0W8-c8XDRqwXFpgOl97gRZG334Iz9UhFV3glrVXuoQczQdSldK5GxaCFrBVWYc23zPfQLAg1yy31MhUNkTGllUC8S-P2xcXsdRQ1gCAzbw4MHOT8He2ero6E4NK-LwRLgA6yxI/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-02-29+%25E4%25B8%258B%25E5%258D%25882.34.10.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
選第一個Run External tool&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7dFokAYi2_UE3yBhSjO9gWlCiHROzr90NGw576a4mAiBVH-AHeD_b1EnRThi0VU6QkgLc7W7ErVFD2BvBgLooXfo_WwFZvbYZpjOXryiI-O_uXTiM_duaKxh1r_-F1Jt_EiIDB2S_H8k/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-02-29+%25E4%25B8%258B%25E5%258D%25882.37.09.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7dFokAYi2_UE3yBhSjO9gWlCiHROzr90NGw576a4mAiBVH-AHeD_b1EnRThi0VU6QkgLc7W7ErVFD2BvBgLooXfo_WwFZvbYZpjOXryiI-O_uXTiM_duaKxh1r_-F1Jt_EiIDB2S_H8k/s400/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-02-29+%25E4%25B8%258B%25E5%258D%25882.37.09.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
各欄位填入&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
Name: Cocos compile&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
Program: cocos&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
Parameters: compile -p android —no-apk —android-studio&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
Working directory: $&lt;span class=&quot;s1&quot;&gt;ProjectFileDir$&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjavNBuH_yvN5Y46YC1hGtxwk2o2dXa3TxXb3rKgepGsEEuzqxDtwx5sm_UVsr0YWO92PNOnONB9igsrmd7kXQB49rOPaRixhJ4HebpuE1pHENvQCXxUsJV1ZO1Z3RDuh42ziuzBS27ikM/s1600/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-02-29+%25E4%25B8%258B%25E5%258D%25882.39.00.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;230&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjavNBuH_yvN5Y46YC1hGtxwk2o2dXa3TxXb3rKgepGsEEuzqxDtwx5sm_UVsr0YWO92PNOnONB9igsrmd7kXQB49rOPaRixhJ4HebpuE1pHENvQCXxUsJV1ZO1Z3RDuh42ziuzBS27ikM/s320/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-02-29+%25E4%25B8%258B%25E5%258D%25882.39.00.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
然後按下ok就完成了。但這裡還有個地方要注意，要把新增的Cocos compile移到&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
Gradle-aware Make的上方,就像第三張圖那樣,編譯時就會先跑c++,再包成apk。&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/3282080491290949990/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2016/02/android-studiococos2d-x.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/3282080491290949990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/3282080491290949990'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2016/02/android-studiococos2d-x.html' title='在android studio編譯cocos2d-x'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIh09MArZcrNW0R8sqZfCjYoSRdiT6MPZidg_B9KamwG7qGkYAgim9R3zaQe3dmgWHeo1mufao94kz-jRehJeXV8GkXbtrccDmYsR_jUr8FU6uvH4zeZScFQa7QG1UnV0OvT6DmuaiRK8/s72-c/%25E8%259E%25A2%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7+2016-02-29+%25E4%25B8%258B%25E5%258D%25882.28.51.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-807029262808506701</id><published>2015-03-19T10:57:00.001+08:00</published><updated>2015-12-31T21:39:05.618+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby on Rails"/><title type='text'>新增一個Model Comment</title><content type='html'>配合post，增加comment功能，從上手指南7開始。&lt;br /&gt;
要注意一下中文的指南還是舊的，照著做會出錯的，大約從英文版的指南 6.4 Generating a Controller&lt;br /&gt;
開始看，再對照修改一下，以下列出重點。&lt;br /&gt;
先來產生 Model&lt;br /&gt;
&lt;br /&gt;
rails generate model Comment commenter:string body:text post:references&lt;br /&gt;
&lt;br /&gt;
沒有用到scaffolding，只建了model&lt;br /&gt;
&lt;br /&gt;
/////////////////////////////////////////////////////////////////////////&lt;br /&gt;
&lt;br /&gt;
CommentsController.rb的內容改成如下：&lt;br /&gt;
class CommentsController &amp;lt; ApplicationController&lt;br /&gt;
&amp;nbsp; def create&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @post = Post.find(params[:post_id]) #是這篇留言所屬的文章&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @comment = @post.comments.create(comment_params) #留言本身&lt;br /&gt;
&amp;nbsp; &amp;nbsp; redirect_to post_path(@post) #最後回到show action顯示 app/views/posts/show.html.erb&lt;br /&gt;
&amp;nbsp; end&lt;br /&gt;
private&lt;br /&gt;
&amp;nbsp; def comment_params&lt;br /&gt;
&amp;nbsp; &amp;nbsp; params.require(:comment).permit(:commenter, :body)&lt;br /&gt;
&amp;nbsp; end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////////////&lt;br /&gt;
&lt;br /&gt;
app/views/posts/show.html.erb 增加了留言的顯示與輸入&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Comments&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;% @post.comments.each do |comment| %&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;p&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;b&amp;gt;Commenter:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;%= comment.commenter %&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;p&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;b&amp;gt;Comment:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;%= comment.body %&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;%= form_for([@post, @post.comments.build]) do |f| %&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;div class=&quot;field&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;%= f.label :commenter %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;%= f.text_field :commenter %&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;div class=&quot;field&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;%= f.label :body %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;%= f.text_area :body %&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;div class=&quot;actions&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;%= f.submit %&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
然後文章跟留言都可以運作，接著依指南往下做就好了。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/807029262808506701/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2015/03/model-comment.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/807029262808506701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/807029262808506701'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2015/03/model-comment.html' title='新增一個Model Comment'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-7765783389549172135</id><published>2015-03-13T15:49:00.003+08:00</published><updated>2015-03-13T15:49:50.684+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby on Rails"/><title type='text'>理解 posts_controller.rb</title><content type='html'>抓幾行來理解一下：&lt;br /&gt;
&lt;br /&gt;
before_action :set_post, only: [:show, :edit, :update, :destroy]&lt;br /&gt;
&lt;br /&gt;
before_action 意思就是執行其它的action前要先執行指定的method，這裡就是set_post，&lt;br /&gt;
後面的only是限定要作用的action。&lt;br /&gt;
&lt;br /&gt;
//////////////////////////////////////////////////////////////////&lt;br /&gt;
&lt;br /&gt;
def index&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @posts = Post.all&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
進了Blog就是執行這個action，這裡把@posts設定好後，就會拿app/views/posts/index.html.erb&lt;br /&gt;
來顯示了。&lt;br /&gt;
&lt;br /&gt;
//////////////////////////////////////////////////////////////////&lt;br /&gt;
&lt;br /&gt;
def post_params&lt;br /&gt;
&amp;nbsp; &amp;nbsp; params.require(:post).permit(:name, :title, :content)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
params是http request所傳來一部份的值。&lt;br /&gt;
這可以取得post這個model的參數，後頭的permit是限定只取哪些參數&lt;br /&gt;
&lt;br /&gt;
//////////////////////////////////////////////////////////////////&lt;br /&gt;
&lt;br /&gt;
def create&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @post = Post.new(post_params) #取到的參數就可以實例化一個Post物件了。&lt;br /&gt;
&lt;br /&gt;
//////////////////////////////////////////////////////////////////&lt;br /&gt;
&lt;br /&gt;
respond_to do |format|&lt;br /&gt;
依請求的格式，返回不同的數據，如下：&lt;br /&gt;
format.html { redirect_to @post, notice: &#39;Post was successfully created.&#39; }&lt;br /&gt;
format.json { render :show, status: :created, location: @post }&lt;br /&gt;
&lt;br /&gt;
redirect_to和render是回應瀏覽器的方式&lt;br /&gt;
redirect_to @post 指示瀏覽器對一個 rul 再次發出請求，例如這邊是相當於讓瀏覽器執行 http://localhost:3000/posts/1 ,&lt;br /&gt;
render :show 就是把 show.html.erb 解析為html回傳給瀏覽器&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/7765783389549172135/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2015/03/postscontrollerrb.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/7765783389549172135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/7765783389549172135'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2015/03/postscontrollerrb.html' title='理解 posts_controller.rb'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-7140156119401127212</id><published>2015-03-08T21:14:00.000+08:00</published><updated>2015-03-08T21:14:00.039+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby on Rails"/><title type='text'>Ruby入門</title><content type='html'>Rails上手指南要往下看的話，Ruby就算不熟至少也要入門一下，&lt;br /&gt;
這裡的二十分鐘體驗可以先參考&lt;br /&gt;
https://www.ruby-lang.org/zh_tw/documentation/quickstart/&lt;br /&gt;
&lt;br /&gt;
這邊做個筆記&lt;br /&gt;
&lt;br /&gt;
#{name} 字串內嵌，在字串中插入資料的方式&lt;br /&gt;
那個name是範例的變數，可以用其它的程式碼代換掉，例如1+1，&lt;br /&gt;
所以 &quot;#{1+1}&quot; 顯示出的字串為 2&lt;br /&gt;
只是這東西要放在&quot;&quot;內，試了一下沒放在&quot;&quot;裡就沒效果了。&lt;br /&gt;
&lt;br /&gt;
類別的名稱要定義成常數，也就是第一個字為大寫 class Greeter&lt;br /&gt;
不然會吐錯誤訊息：class/module name must be CONSTANT&lt;br /&gt;
&lt;br /&gt;
class內宣告的變數要加上 @ 符號，沒加會出現錯誤 undefined local variable or method&lt;br /&gt;
&lt;br /&gt;
像這樣的變數 @name 類別外無法存取，所以有個 attr_accessor 的類別方法，如下使用：&lt;br /&gt;
class Greeter&lt;br /&gt;
&amp;nbsp; attr_accessor :name&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
為什麼連Greeter宣告都要再寫一遍？這展示了一個特性，你可以隨時修改類別。&lt;br /&gt;
&lt;br /&gt;
respond_to 可以判斷物件是否有某種方法，下面有2種寫法&lt;br /&gt;
if @names.respond_to?(&quot;each&quot;)&lt;br /&gt;
if @names.respond_to?　:each&lt;br /&gt;
&lt;br /&gt;
可使用 each 方法的物件迭代的方法如下：&lt;br /&gt;
@names.each do |name|&lt;br /&gt;
&amp;nbsp; #這裡可以加入程式碼處理 name 變數&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
有一個特別的技巧 if __FILE__ == $0 可以拿來寫程式碼測試&lt;br /&gt;
__FILE__ 是檔案名　&lt;br /&gt;
$0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 是執行檔名&lt;br /&gt;
所以不相同時表示是方法庫，就不會執行到裡面的程式了。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/7140156119401127212/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2015/03/ruby.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/7140156119401127212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/7140156119401127212'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2015/03/ruby.html' title='Ruby入門'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-5353909818349476589</id><published>2015-03-05T10:32:00.001+08:00</published><updated>2015-03-05T10:32:00.418+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby on Rails"/><title type='text'>使用 scaffolding</title><content type='html'>Rails 的 鷹架 (scaffolding) 可用一行指令就為 Resource 建立 Model, Views 跟 Controller 程式碼。&lt;br /&gt;
下面要建立部落格文章管理功能。&lt;br /&gt;
&lt;br /&gt;
建立 Post resource&lt;br /&gt;
rails generate scaffold Post name:string title:string content:text&lt;br /&gt;
&lt;br /&gt;
執行 Migration 建立了 Posts 資料表&lt;br /&gt;
rake db:migrate&lt;br /&gt;
&lt;br /&gt;
接著修改app/views/home/index.html.erb,再加一行&lt;br /&gt;
&amp;lt;%= link_to &quot;My Blog&quot;, posts_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
刷新瀏覽器後點了連結就可以操作了。&lt;br /&gt;
&lt;br /&gt;
順著指南從6.5開始看，在新增post時，若輸入空白也可以加入，所以要為欄位加上驗證&lt;br /&gt;
&lt;br /&gt;
加入Validation (驗證)&lt;br /&gt;
打開app/models/post.rb在post類別內補上驗證的程式碼&lt;br /&gt;
class Post &amp;lt; ActiveRecord::Base&lt;br /&gt;
&amp;nbsp; validates :name, &amp;nbsp;:presence =&amp;gt; true&lt;br /&gt;
&amp;nbsp; validates :title, :presence =&amp;gt; true,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; :length =&amp;gt; { :minimum =&amp;gt; 5 }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
其實有沒有效果執行網頁就知道了，但有另一種方式就是console工具&lt;br /&gt;
執行rails console&lt;br /&gt;
接著就可以執行ruby的程式,也是一種方法。&lt;br /&gt;
&lt;br /&gt;
往指南6.7往下看之前，先理解這些檔案之間的關連&lt;br /&gt;
&lt;br /&gt;
以按下My Blog連結為例，就會執行到 app/controllers/posts_controller.rb 程式內 index 這個 action,&lt;br /&gt;
裡面的程式 @posts = Post.all 使用到了 app/models/post.rb 這個模組，&lt;br /&gt;
最後靠 app/views/index.html.erb 顯示出來&lt;br /&gt;
&lt;br /&gt;
那麼為什麼會去執行index這action呢？還記得之前設定過的config/routes.rb檔嗎？&lt;br /&gt;
裡面有一行 resources :posts 有了這一行就會自動定義出以下七個action&lt;br /&gt;
get &amp;nbsp; &amp;nbsp;&#39;/posts&#39; &amp;nbsp;=&amp;gt; &quot;posts#index&quot;, &amp;nbsp; :as =&amp;gt; &quot;posts&quot;&lt;br /&gt;
post &amp;nbsp; &#39;/posts&#39; =&amp;gt; &quot;posts#create&quot;, &amp;nbsp;:as =&amp;gt; &quot;posts&quot;&lt;br /&gt;
get &amp;nbsp; &amp;nbsp;&#39;/posts/:id&#39; =&amp;gt; &quot;posts#show&quot;, &amp;nbsp; &amp;nbsp;:as =&amp;gt; &quot;post&quot;&lt;br /&gt;
put &amp;nbsp; &amp;nbsp;&#39;/posts/:id&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; &quot;posts#update&quot;, &amp;nbsp;:as =&amp;gt; &quot;post&quot;&lt;br /&gt;
delete &#39;/posts/:id&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; &quot;posts#destroy&quot;, :as =&amp;gt; &quot;post&quot;&lt;br /&gt;
get &amp;nbsp; &amp;nbsp;&#39;/posts/new&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; &quot;posts#new&quot;, &amp;nbsp; &amp;nbsp; :as =&amp;gt; &quot;new_post&quot;&lt;br /&gt;
get &amp;nbsp; &amp;nbsp;&#39;/posts/:id/edit&#39; =&amp;gt; &quot;posts#edit&quot;, &amp;nbsp; &amp;nbsp;:as =&amp;gt; &quot;edit_post&quot;&lt;br /&gt;
&lt;br /&gt;
所以按下My Blog連結，就是第一行的設定了。&lt;br /&gt;
&lt;br /&gt;
到了這邊，沒碰過Ruby的話，要先補充一下，下面的連結可以好好參考。&lt;br /&gt;
https://ihower.tw/rails4/ruby.html</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/5353909818349476589/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2015/03/scaffolding.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/5353909818349476589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/5353909818349476589'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2015/03/scaffolding.html' title='使用 scaffolding'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1836936334136210687.post-5079778926978944635</id><published>2015-03-01T14:04:00.001+08:00</published><updated>2015-03-01T14:04:24.226+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby on Rails"/><title type='text'>Hello, Rails</title><content type='html'>裝好Ruby On Rails後，可參考Rails指南的操作 http://guides.ruby.tw/rails3/getting_started.html&lt;br /&gt;
從第3點 建立新的 Rails 專案依序操作&lt;br /&gt;
&lt;br /&gt;
先啟動rvm&lt;br /&gt;
source ~/.rvm/scripts/rvm&lt;br /&gt;
&lt;br /&gt;
到目錄下&lt;br /&gt;
cd myblog&lt;br /&gt;
&lt;br /&gt;
建資料庫&lt;br /&gt;
rake db:create&lt;br /&gt;
&lt;br /&gt;
啟動web伺服器&lt;br /&gt;
rails server&lt;br /&gt;
&lt;br /&gt;
///////////////////////////////////////////&lt;br /&gt;
&lt;br /&gt;
準備好了就先作最簡單的練習 hallo rails&lt;br /&gt;
&lt;br /&gt;
建立Controller與View&lt;br /&gt;
rails generate controller home index&lt;br /&gt;
&lt;br /&gt;
編輯app/views/home/index.html.erb&lt;br /&gt;
加入&amp;lt;h1&amp;gt;Hello, Rails!&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
打開config/routes.rb，修改Rails首頁位置&lt;br /&gt;
找到 # root &#39;welcome#index&#39; 這一行&lt;br /&gt;
改成 root &#39;home#index&#39; 存檔&lt;br /&gt;
&lt;br /&gt;
瀏覽器打開 http://localhost:3000 ，就會看到 Hello, Rails! 。</content><link rel='replies' type='application/atom+xml' href='http://chadgod.blogspot.com/feeds/5079778926978944635/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chadgod.blogspot.com/2015/03/hello-rails.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/5079778926978944635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1836936334136210687/posts/default/5079778926978944635'/><link rel='alternate' type='text/html' href='http://chadgod.blogspot.com/2015/03/hello-rails.html' title='Hello, Rails'/><author><name>chad</name><uri>http://www.blogger.com/profile/15288127898408228247</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>