發表文章

目前顯示的是 2015的文章

[Unity] 透過 Soomla 來實做 In-app purchase,以Android 為例 (Google Billing Service) , 和 Admob 不相容問題處理

圖片
Soomla  Store 的 Assets Store Link https://www.assetstore.unity3d.com/en/#!/content/6103 但是上面這個連結的Plugin 已經太舊了,且上面Youtube 的教學影片也是舊的,所以建議還是直接到官方的github 比較正確https://github.com/soomla/unity3d-store 那就開始來啦 首先Android  APK 設定 (須設定可以上傳的 就是sign key 和  package name 要用真的) 去下載 plugin : http://library.soom.la/fetch/unity3d-store/1.9.2?cf=github 匯入剛下載plugin 到 Soomla 的設定 設定如下 Soomla Secret : 自行決定加密的key , Google Play API Key : 等下再輸入 到 google play Developer Console https://play.google.com/apps/publish/,新增一個應用程式,或是選擇一個應用程式 到 服務和API 選項,複製授權金鑰 然後把授權金鑰貼到 Soomla 的Google Play API Key 上 此時再到Google Console 的 應用程式商品建立商品 建立完成回到Unity 建立一個 Billing Assert C# Script <= 用來記錄商品的資訊  ( FOURHUNDMUFF_PACK_PRODUCT_ID   <== 這裡是要填入之前Google play 的商品ID  )  using UnityEngine ; using System . Collections ; using Soomla . Store ; using System ; using System . Collections . Generic ; public class GoodAssets : IStoreAssets { public VirtualCategory [ ] G

[Unity] 使用Collider 2D 和 Rigibody 2D 如何不讓物件重疊

圖片
如題 如果什麼都不設定的話,常常看到物件會重疊再一起如下圖所示 但是如果在 Rigibody 2D 的設定增加 Collision Detection : Discrete 改成 Continuous , 如下圖設定 這樣就可以解決這個問題,如下圖所示

Unity 如果使用 Google Admob (Android 版)

圖片
1. 首先當然 你需要 Admob 帳號  請參考這篇 http://imax-live.blogspot.tw/2012/11/admod-account-payment-paypal.html 2.申請完後,請先下載 Google Mobile Ads Unity Plugin 3.打開Unity -> Assert -> import Package -> Custom Package  4.匯入剛下載的GoogleMobileAds.unitypackage 5.匯入成功後,會看到專案下多了Plugin 資料夾 6.去自己的 Andorid SDK 資料夾 (沒有的話記得先去 下載   ) ,找到 Google Play Lib : [sdk]\extras\google\google_play_services\libproject\google-play-services_lib 7. 複製到 Unity Assert/Plugin 目錄下 8.在Unity 建立一個 場景(Sence) 9.建立一個按鈕的 , 並且有監聽事件的C# 的 Script 10. 在監聽事件中 貼上以下 code using GoogleMobileAds . Api ; … private void RequestBanner () {     #if UNITY_ANDROID         string adUnitId = "INSERT_ANDROID_BANNER_AD_UNIT_ID_HERE" ;     #elif UNITY_IPHONE         string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE" ;     #else         string adUnitId = "unexpected_platform" ;     #endif     // Create a 320x50 banner at the top of the screen.     BannerVie

Unity C# 如何匯入 JSON.net (Newtonsoft.Json.Net20.dll)

圖片
之前匯入 Newtonsoft.Json 一直會遇到compiler error,結果是匯入的dll 有分 不多說趕快看下面說明 1. 先到官網下載  http://json.codeplex.com/ 2.點擊"Downloads" 3.選擇自己Unity 對應的 .net 版本 4.下載並解開壓縮檔,到bin 目錄 5.選擇 "DotNet20" 目錄 6.複製 Newtonsoft.Json.Net20.dll 7 在自己的Unity Project 中創立 Lib 目錄 8.將剛複製的dll 拖曳到此 目錄 就大功告成了 然後就可以使用 Json 了 example public static T Clone < T >( T source ) { var serialized = JsonConvert . SerializeObject ( source ); return JsonConvert . DeserializeObject < T >( serialized ); }

AWS Lambda 可以跑在 Java Code 上了!!!

圖片
AWS Lambda Update – Run Java Code in Response to Events by Jeff Barr | on  15 JUN 2015  | in  AWS Lambda  |  Permalink Many AWS customers are using  AWS Lambda  to build clean, straightforward applications that handle image and document uploads, process log files from  AWS CloudTrail , handle data streamed from  Amazon Kinesis , and so forth. With the recently launched synchronous invocation capability, Lambda is fast becoming a favorite choice for building mobile, web and  IoT  backends. Our internal mailing list is awash with discussions about interesting ways to use Lambda, many of which would fall squarely into the traditional data processing realm. These customers love Lambda because they can focus on their application and leave the hosting and scaling duties to us. To date, developers have written their Lambda functions in  Node.js , a derivative of JavaScript designed specifically for use in server-side applications. Lambda Functions in Java Today we are making Lambda e

IWAB0503E Unable to update Java build path. Please check your system environment. java.io.FileNotFoundException: /lib/saaj.jar 解決辦法

圖片
這是 用 eclpse STS 的 BUG 主要是 soap 1.3 plugin 忘了放 /saaj.jar 先到 ecplse/plugin 目錄下 找到 javax.xml.soap_1.2.0xxxxxxxxx 目錄如下圖所示 然後將裡面的 lib 目錄複製出來 然後貼到 javax.xml.soap_1.3.0xxxxxxxxx  目錄下 然後重啟STS 就可以用 WebServices Client 了!!!

JPA entity 使用繼承關係時,發生 Cannot use identity column key generation with mapping for: {class xxxx} 如何解決

先定義Root(父類) 的表如下 @SuppressWarnings("serial") @Entity @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public abstract class AbsEnum implements Serializable { private Integer id; private String name; private String enName; private Integer operatorId; private Date updatedAt; @Id @Column(nullable = false , columnDefinition = JpaConstant.COLUMN_DEFIN_ID) @GeneratedValue(strategy = GenerationType.TABLE) public Integer getId() { return id; } public void setId( Integer id) { this .id = id; } public String getName() { return name; } public void setName( String name) { this .name = name; } public String getEnName() { return enName; } public void setEnName( String enName) { this .enName = enName; } public Integer getOperatorId() { return operatorId; } public void setOperatorId( Integer operatorId) { this .operatorId = operatorId; } public Da