unity5

Debug.DrawLine not showing in the GameView

删除回忆录丶 提交于 2019-12-07 10:07:02
问题 I'm working on a 2D Unity app and I'm encountering some weird behavior. This code works just fine. Debug.DrawLine(button1.transform.position, button2.transform.position, Color.green); When I run the app, I see a green line in the Scene view. But nothing appears in the Game view when I have the following line. Physics2D.Linecast(button1.transform.position, button2.transform.position); I'm confused as to how Unity is able to draw a line between these two buttons, but for some reason, it's just

Loading new scene in background

╄→尐↘猪︶ㄣ 提交于 2019-12-07 08:19:16
问题 I'm creating a Unity application targeting the Samsung Gear VR. I currently have two scenes: The initial scene Second scene, with big quantity of data (it takes too much time to load the scene). From the first scene, I want to load the second scene in background, and switch to it once it has been loaded. While the new scene is loading in background, the user should keep the ability to move their head to see any part of the VR environment. I'm using SceneManager.LoadSceneAsync but it's not

Unity 5.3 - Input field wont detect first “return” key when pressed

拥有回忆 提交于 2019-12-07 08:10:41
问题 I have to double press "return" key for the value to be submitted! It was working fine like 2 hours ago(i only needed to press return once), but then i restarted Unity and now i need to double press "return" for the value to be submitted. Update #2 I have a script attached to the canvas that is holding the Input Field. The code as follows :- public class Example: MonoBehaviour { public InputField inputField; void Start () { } void Update () { HandleUserInput (); } void HandleUserInput() { if

When does the LoadScene() function in Unity change the scene?

强颜欢笑 提交于 2019-12-07 04:57:21
问题 When you invoke the function LoadScene() does it immediately switch scenes, or does it simply signal that the scene needs to be changed? The documentation for LoadScene() does not say. The specific example I am working with looks like this: LoadScene(levelName); ItemBox newBox = (ItemBox)Instantiate(...); So with the above code, would the newBox exist in the scene we just loaded, or would it get created in the old scene, then destroyed when the new level is loaded. 回答1: It's UnityEngine

Unity events in animation missing

 ̄綄美尐妖づ 提交于 2019-12-06 21:00:35
I want to use Events in my animation ( my animation is part of my .fbx file which is exported from 3d studio nad I imported to Unity 5.3 ) to change behavior of my character like in http://docs.unity3d.com/Manual/animeditor-AnimationEvents.html but I don't have Events option like in tutorial and when I click double on any moment in timeline no new event is created. How to add Events option to animation ( I know how to add callbacks once I have option for events from previous tutorial ) Animation events have to be added in the "Animation" window (not "Animator"). Open it, then select a

aafdex-sdk unity3d crash on scene transition - only on Android

╄→尐↘猪︶ㄣ 提交于 2019-12-06 16:01:46
I've been developing an application for emotion recognition using Affectiva's affdex-sdk (v2.2) for Unity 5.4. My application consists of 3 scenes, then I use affectiva's Camera_Detector scene, and use an emotion as trigger to go to the next scene. It runs perfectly in UnityEditor and as a Windows compiled package (x86). However when I deploy it to Android (5.0), crashes occur always at runtime when skipping from Camera_Detector scene to the next scene (scene loads previous to Camera_Detector and in Camera_Detector itself never crash). I'm using (in C#) SceneManager.LoadScene("nextscene"); The

Textures loads in editor but not in standalone (appears pink)

坚强是说给别人听的谎言 提交于 2019-12-06 15:45:22
I'm using an asset named Simple Obj , that allows me to import an obj, their materials and the textures associate . This works fine in my editor but not in my standalone. My OBJ are not in my resources file , I take it from another file with the WWW method. Here's how I do it, t his download my OBJ, create a Gameobject and place it in my scene : private IEnumerator DownloadAndImportAllInBackground(string url, Plane newPlane) { string objString = null; string mtlString = null; Hashtable textures = null; GameObject planeObject = null; bool gameObjectPerGroup = false; bool subMeshPerGroup = false

Make texture2D readable in runtime/script Unity3D [duplicate]

心已入冬 提交于 2019-12-06 15:24:32
This question already has an answer here : How to make Texture2D Readable via script (1 answer) Closed 2 years ago . I have a plugin that allows me to access pictures from an Android phones gallery. This gives me a texture of the Texture2D type. I then want to edit it using the GetPixels function, but it is not set to readable by default. How would I make the texture readable so I can use GetPixels on it? Basically I am allowing the user to select a picture from the phone and then crop it. In the following example pic the picture would be cropped by the red rectangle. Which works if I make the

How to properly update Google Analytics Unity plugin

北战南征 提交于 2019-12-06 14:47:24
I have a game for Android with GAv3 installed, if I update Google Analytics to version 4 the game starts but I get some exceptions. Here's a log from Android Device Monitor: 03-15 16:06:44.906: I/Unity(17009): AndroidJavaException: java.lang.ClassNotFoundException: com.google.android.gms.analytics.GoogleAnalytics 03-15 16:06:44.906: I/Unity(17009): java.lang.ClassNotFoundException: com.google.android.gms.analytics.GoogleAnalytics 03-15 16:06:44.906: I/Unity(17009): at java.lang.Class.classForName(Native Method) 03-15 16:06:44.906: I/Unity(17009): at java.lang.Class.forName(Class.java:251) 03

Why does Social.localUser.Authenticate lead to crash when there is no internet connection in Unity app?

佐手、 提交于 2019-12-06 10:19:56
With an internet connection Everything works flawlessly. There is no memory problem leading to crash. With no internet connection The app proceeds to the menu screen, where it eventually crashes because it is out of memory. I have concluded that the problem lies in the following line of code Social.localUser.Authenticate When I comment out the above line, the memory problem goes away when there is no internet connection. Here is my relevant code void Start () { Social.localUser.Authenticate(ProcessAuthentication); } public void ProcessAuthentication(bool success) { if(success) Debug.Log (