unity5

Improve Frame rate on too many UI Images - Unity UI

怎甘沉沦 提交于 2019-12-08 11:52:22
问题 In my single page, there were so many textures those I require to render before I was just facing problem in just screen opening but this I was able to resolve this suggestion: OnBecomeVisible for Canvas UI Objects Here is the actual code that I used for this purpose: public void OnValueChangeRefreshCards (Vector2 valueChange) { elapsedYDist += valueChange.y; if (elapsedYDist > 3f) { elapsedYDist = 0f; for (int i = 0; i < GameConstants.TOTAL_ROSE_COUNT; i++) { Card card = roseList [i]

Firebase realtime database: how can I retrieve 10 records around a specific key after ordered by value?

倾然丶 夕夏残阳落幕 提交于 2019-12-08 10:28:14
问题 I created a simple leaderboard in my Firebase Realtime Database, using Unity: Keys correspond to the user name and the values correspond to the user score. I want to Retrieve first 20 records Retrieve the 5 records around a given user name (upper 2, itself and the lower 2) when ordered by the scores. I manage to retrieve top 100 scores by the following query: FirebaseDatabase.DefaultInstance.GetReference (LEADERBOARD_TABLE_CAPTION).Child (leaderboardName).OrderByValue ().LimitToLast (20) I

Unity events in animation missing

纵饮孤独 提交于 2019-12-08 06:45:23
问题 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 ) 回答1:

ODBC connection to an .accdb file

核能气质少年 提交于 2019-12-08 06:44:12
问题 I am trying to access a microsoft Access database file from a unity project i've been working on, but it keeps throwing an exception because it is unable to find the file and there has been no standard river has been selected. The Code: using UnityEngine; using UnityEngine.UI; using System; using System.Data; using System.Data.Odbc; public class AccDBReader : MonoBehaviour { public string FileName; public string Table_Name; public string Column_name; public DataTable Dt; public string text;

how to snap two objects in runtime in unity?

心已入冬 提交于 2019-12-08 06:03:49
问题 this is the 3d model i wanted to connect another model like this to its silver connectors on top side and also another model to right side(so do help me to snap it)I want to know how to snap two 3D objects together in runtime. i.e during "play" the user must be able to dragup, down, left, right to snap one object with the other object .for example like "lego", ie. one 3D object should snap to another 3D object. How would I achieve this? This is the code I use for dragging: using System

How to properly update Google Analytics Unity plugin

北城以北 提交于 2019-12-08 05:44:35
问题 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

How to get/change Image Source name with code in Unity?

你说的曾经没有我的故事 提交于 2019-12-08 03:45:18
问题 we made a script and need to get the image name, we implement this task with a clumsy way below, but we still want to know whether there is a way to get the image name directly? public class CubeManager { static public Dictionary<CubeType, string> cubeTypeDict = new Dictionary<CubeType, string>(); static private Dictionary<string, GameObject> cubeDict = new Dictionary<string, GameObject>(); static CubeManager() { cubeTypeDict.Add(CubeType.Wall01, "Wall01"); cubeTypeDict.Add(CubeType.Wall02,

Writing RTL in input field

。_饼干妹妹 提交于 2019-12-08 03:04:23
问题 I'm trying to write Persian in unity input fields. Persian is right to left language and it's alphabet is similar to Arabic. I've found a library that converts and corrects the text. It's works just fine. When I'm showing the converted text into Debug.Log() everything is perfect but the problem is when I'm going to put corrected text into input field it would be reversed! I've tried to reversed the input field text but nothing happened! Here's my code public InputField empName; PersianMaker

Unity: Need to reset a pooled object on return to pool. Perhaps using ScriptableObject?

北城余情 提交于 2019-12-07 23:27:39
问题 I have recently been trying out object pooling in unity to speed up the instantiation of several game objects at once. However, since these are fairly complex objects I need to reset them when they go back in the pool. I read that using ScriptableObject might be a good way to store the default values for an easy reset. But in order to do that I need to load a fresh ScriptableObject at runtime to store the actual values of the object. So in pseudocode, i'd have a class with public

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

三世轮回 提交于 2019-12-07 22:28:30
问题 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