unity5

How Can I Package a Unity3D 5 Windows Application into a single exe file?

a 夏天 提交于 2019-12-02 07:47:54
I am new to Unity3d development. I have created two versions of a 3D puzzle app, one for Mac and the other for Windows. Mac applications are created with the package contents contained within it. The Windows application is created with the exe file and a separate data folder with the same name as the exe file + suffix _Data. I want to create a single exe file to distribute on Amazon and other downloadable platforms. The problem I'm having is finding something where the data folder and the exe file have to be located at the same level. I'm used to Apple devices but recently purchased a Windows

Using Fabric with Multidex with an exported Unity project

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 05:02:03
I have exported my Unity project to be able to use multidex. Problem is I have to set the android:name in the project's androidmanifest to "android.support.multidex.MultiDexApplication" when I already have this "io.fabric.unity.android.FabricApplication" set for fabric. I have tried initializing Fabric manually but then I get this error : AndroidJavaException: io.fabric.unity.android.FabricInitializationException: Fabric did not find a valid application context. I have found that someone had a similar problem but it didn't got solved: https://twittercommunity.com/t/unity-android-plugin

Play and wait for audio to finish playing

扶醉桌前 提交于 2019-12-02 04:39:52
问题 in my project I want a sound to play and then for an objects active state to be set to false, at the moment both are happening at the same time so the sound doesn't play. If I keep the active state as true then I will hear the sound play. How can I make sure that the audio finishes before the set active state is switched to false, any help or advice is appreciated. Here's a selection of my code; void OnTriggerEnter(Collider other) { if (other.tag == "Pick Up") { if (!isPlayed) { source.Play (

Unity3d restart current scene

孤街醉人 提交于 2019-12-02 04:29:13
Ok so I am trying to restart the scene on R being pressed and for some reason, I am getting errors like, well in the unity console: "unexpected symbol '}' " and "parsing error". But then in Microsoft visual studio I'm getting "; expected". Any ideas of what's wrong with the following code? void Update() { if (Input.GetKeyDown(KeyCode.R)) SceneManager.GetActiveScene().buildIndex } You must ask the scene manager to load the scene using LoadScene if (Input.GetKeyDown(KeyCode.R)) SceneManager.LoadScene( SceneManager.GetActiveScene().buildIndex ) ; You were just retrieving the build index of the

SmackInitialization: Could not determine Smack version

≯℡__Kan透↙ 提交于 2019-12-02 03:24:05
I am making an android plugin for Unity, I need to integrate XMPP in Unity so first I am trying to create a connection of XMPP and send and receive a message. It's working fine in android, I am able to send and receive message But when I export .jar file and use in Unity so I got below error while I create connection SmackInitialization: Could not determine Smack version java.lang.NullPointerException: lock == null at java.io.Reader.<init>(Reader.java:64) at java.io.InputStreamReader.<init>(InputStreamReader.java:122) at java.io.InputStreamReader.<init>(InputStreamReader.java:57) at org

Greyed out my codes of null checking before invoking a delegate

蹲街弑〆低调 提交于 2019-12-02 03:19:57
I write unity codes in VS 2015, which means it's in c#4 and the null condition operator is not available. Before invoking a delegate, I did a null check. However the codes are greyed out. Does it mean the grey codes are not effective just like comments? If so what should I do to prevent invoking a null delegate? public delegate void PtjAnimCtrlDelegateColiderSetEnabledTo(bool value); public PjtAnimCtrlDelegateColliderSetEnabledTo colliderSetEnabledToHandler; public delegate void PjtAnimCtrlDelegate(); public PjtAnimCtrlDelegate explosionAnimationFinishedHandler; public PjtAnimCtrlDelegate

Accessing dimensions (width/height) from a VideoPlayer source URL

爱⌒轻易说出口 提交于 2019-12-02 01:29:00
问题 I am working on a Unity project that requires me to download a video file (mp4 format) and play it using the VideoPlayer component. Because the file is downloaded at runtime, I effectively have to "stream" it via a url to its downloaded location, as opposed to loading it as a VideoClip. To accurately size the target RenderTexture and GameObject the video will be playing to, I need the dimensions of the video file itself. Because it is not a VideoClip I cannot use: VideoClip clip = videoPlayer

Unity cannot set ActiveScene

不问归期 提交于 2019-12-01 14:53:16
I'm switching scenes: SceneManager.LoadScene("Scene2"); Debug.Log("Current scene: " + SceneManager.GetActiveScene().name); Debug says: Current scene: Scene1 I've tried this also: SceneManager.LoadScene("Scene2"); StartCoroutine(WaitUntilEndOfFrame()); Debug.Log("Current scene: " + SceneManager.GetActiveScene().name); private IEnumerator WaitUntilEndOfFrame() { yield return new WaitForEndOfFrame(); } Still says Current scene: Scene1. I've tried SetActiveScene(SceneManager.GetSceneByBuildId(1)); I've tried launching that as a coroutine, I've tried that and waiting for 5 seconds. Still

Unity cannot set ActiveScene

走远了吗. 提交于 2019-12-01 12:59:23
问题 I'm switching scenes: SceneManager.LoadScene("Scene2"); Debug.Log("Current scene: " + SceneManager.GetActiveScene().name); Debug says: Current scene: Scene1 I've tried this also: SceneManager.LoadScene("Scene2"); StartCoroutine(WaitUntilEndOfFrame()); Debug.Log("Current scene: " + SceneManager.GetActiveScene().name); private IEnumerator WaitUntilEndOfFrame() { yield return new WaitForEndOfFrame(); } Still says Current scene: Scene1. I've tried SetActiveScene(SceneManager.GetSceneByBuildId(1))

How can I detect nearby GameObjects without physics/raycast?

▼魔方 西西 提交于 2019-12-01 12:22:42
I am trying to detect the object's within a range having the player as origin point. How can I find the Transforms from a given area around the player without using colliders or Physics.OverlaptSphere() I don't want to use this method because the only information I need is the Transform of nearby Objects from a given LayerMask (more specifically, the position and rotation) If I would use Physics I would have to put a trigger over every point which I find unnecessary. Is there other method of finding the nearby points other but similar to the one that uses Physics? If you want yo do this