unity

Unity IOC container and how to resolve different instances of the same interface

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a unity container that I am registering types within like so: IUnityContainer container = new UnityContainer() .RegisterType ( "PopulationRate" ) .RegisterType ( "BusinessLicenseRate" ); Then I also want to register 2 different services that take a ITaxAuthorityRateService variable in their constructor. Both services need a different class that derives from ITaxAuthorityRateService. How can I handle that situation? 回答1: Ok I figured it out. Keeping the names the same during registration is correct ("PopulationRate" and

In unity3D, Click = Touch?

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I want to detect click/touch event on my gameObject 2D. And this is my code: void Update () { if ( Input . touchCount > 0 ) { Debug . Log ( "Touch" ); } } Debug.Log("Touch"); does not show when I click on screen or my gameObject. 回答1: Short answer: yes, touch may be handled with Input.GetMouseButtonDown() . Input.GetMouseButtonDown() , Input.mousePosition , and associated functions work as tap on the touch screen (which is kind of odd, but welcome). If you don't have a multi-touch game, this is a good way to keep the in-editor game

Unity- Photosphere Photo Viewer for Google Cardboard

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to build a Photosphere-like application with Unity3D and use it along with Google cardboard. I need to load different panoramic view photos and be able to view them stereoscopically, by using the Cardboard goggles. I am having problem to use the pano images and render it into stereoscopic view in Unity. Any suggestions will be gratefully received. 回答1: Simplest solution that I can give to you: A. Install your Unity Pro with Android Pro plugins, setup Cardboard SDK For Unity , install Android Build tools and SDK. B Setup Skybox

How to prepare a Unity project for git? [duplicate]

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: How to use Git for Unity3D source control? 11 answers What are the steps necessary to prepare a Unity project for committing to a git repository eg. github? I don't want to store unnecessary files (specially temp files and avoid binary formats as much as possible). 回答1: On the Unity Editor open your project and: Enable External option in Unity → Preferences → Packages → Repository (only if Unity ver Switch to Visible Meta Files in Edit → Project Settings → Editor → Version Control Mode Switch to

Facebook UNITY SDK login issue

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I just installed the new version of Unity 4.3 and the new facebook sdk and I can't get it working. I created the app on facebook, copied over the app id to the unity facebook settings as required and copied the Package Name and Class name back to facebook. Because the Android Key Hash is empty ( even it shouldn't be ) I used the methods posted by others to create one with openssl. I created it and copied over to facebook as required. After this I created a small script to be able to login. // Use this for initialization void Start () {

Simple event system in Unity

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use the event system in Unity (the C# way), but I am having problems to implement it. Most of the examples, show one class, where you define the handler; then you write in the same class, the function that match the signature of the handler, and you write the events as static public class EventExample : MonoBehaviour { public delegate void ExampleEventHandler(); public static event ExampleEventHandler OneDayPassed; public static void NextTurn() { // do stuff then send event if (OneDayPassed != null) OneDayPassed(); } } Then in

Unity IoC for resolving assemblies dynamically

匿名 (未验证) 提交于 2019-12-03 01:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We are using unity as IoC. We came across unique problem. We have created interface called IPlugin. This interface is shared across various third party vendors to develop their own plug in based on this interface. These plug ins then fits into our system. Vendors will provide their plugs in as dll. What we want is , Using unity we want to resolve all assembly’s type which is implemented with IPlugin interface. I came to know that this is achievable via MEF export attribute, I am wondering whether this can be achieved via Unity using some

Unity AdMob iOS SDK linker error

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am struggling to compile the iOS AdMob SDK in xcode. After whole day of solving the "Module GoogleMobileAds.framework can not be found" problem, I finally made it through successful compile, but now the linker fails. These are the errors it displays: Undefined symbols for architecture armv7: "__kmsetForChildren", referenced from: _Admob__kmsetForChildren_m1210033255 in Bulk_Assembly-CSharp-firstpass_0.o "__kmisInterstitialReady", referenced from: _Admob__kmisInterstitialReady_m1074969033 in Bulk_Assembly-CSharp-firstpass_0.o (maybe you

Unity Unibill Plugin issue with Amazon testing, AMAZONAPPSTORE_GETITEMDATAREQUEST_NO_PRODUCTS_RETURNED

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I got Unibill set up for my Unity project and everything is fine with Android payments. Now trying to get it running for Amazon and it is not working. I tried it with "Amazon Sandbox" turned on and turned off. I tried it with a pre-made "amazon.sdktester.json" and with the one that gets created automatically with Unibill. Nothing seems to work. I keep getting the following error: In App Purchasing SDK - Sandbox Mode: PurchasingListener Context: com.unity3d.player.UnityPlayerNativeActivity@41a3ea20 UnibillBiller: GetItemDataRequest returned