unityscript

How to call method and return its value with UnityPlayer.UnitySendMessage

隐身守侯 提交于 2019-11-29 07:07:55
How can I call this C# method from Java then return the string value? public string getTest () { return "test"; } This is what I've tried: String str = UnityPlayer.UnitySendMessage("ProfileSave", "getTest",""); I am getting the below error String str=UnityPlayer.UnitySendMessage("ProfileSave", "getTest",""); ^ required: String found: void Programmer UnityPlayer.UnitySendMessage is a void function and does not return a value. Take a look at the UnitySendMessageExtension function implementation below. It is similar to turnipinindia's answer but it returns a value. It only returns a string so you

Unity 2017.10f3 .Net 4.6 target issue

放肆的年华 提交于 2019-11-28 12:52:06
I've updated the player settings API to be 4.6 as documented. But my project is still targeting 3.5. I also tried to manually update the csproj to 4.6 But after unity was opened it overrided it again to 3.5. Notice that I've update the Visual Studio Tools For Unity to the latest version (3.1.0.0) Anything I'm missing? Is this a known bug? If so, is there a workaround? Programmer You have to enable this from the Editor itself. By the way, you can now download the latest version which is no longer in beta mode. Go to Edit --> Project Settings --> Player --> Other Settings --> Configuration -->

How to call method and return its value with UnityPlayer.UnitySendMessage

倖福魔咒の 提交于 2019-11-28 00:44:02
问题 How can I call this C# method from Java then return the string value? public string getTest () { return "test"; } This is what I've tried: String str = UnityPlayer.UnitySendMessage("ProfileSave", "getTest",""); I am getting the below error String str=UnityPlayer.UnitySendMessage("ProfileSave", "getTest",""); ^ required: String found: void 回答1: UnityPlayer.UnitySendMessage is a void function and does not return a value. Take a look at the UnitySendMessageExtension function implementation below

Unity 2017.10f3 .Net 4.6 target issue

匆匆过客 提交于 2019-11-27 07:23:13
问题 I've updated the player settings API to be 4.6 as documented. But my project is still targeting 3.5. I also tried to manually update the csproj to 4.6 But after unity was opened it overrided it again to 3.5. Notice that I've update the Visual Studio Tools For Unity to the latest version (3.1.0.0) Anything I'm missing? Is this a known bug? If so, is there a workaround? 回答1: You have to enable this from the Editor itself. By the way, you can now download the latest version which is no longer in

Is Unityscript/Javascript discontinued?

≡放荡痞女 提交于 2019-11-27 02:16:28
I am using Unity 2017.2.0b5 . I tried to help somebody who asked a question about Unityscript few moments ago but I noticed that: Assets > Create > C# Script is present but Assets > Create > JavaScript is missing. This is also missing from the Project tab and the Create new script menu which is on the Add Component menu. I read the release note but couldn't find anything about Unityscript/Javascript. Has Unity just killed Unityscript/JavaScript support like Boo? According to some comments on the Unity forums: One user said back in February, " UnityScript has already been abandoned. Just no one

How to speed up the build and run process in unity for mobile devices iOS/Android [closed]

岁酱吖の 提交于 2019-11-26 06:47:14
问题 Hi I\'m developing a game in unity and I need test this game in iOS. For particular case I need test the input touch for controllers but this takes much time. When I change some lines of code in script C#, I must re-build iOS game in unity, after that I must build and run the Xcode project for testing and run the game on my iPhone. This process takes much time, so the question is if there are some ways to accelerate this process ? 回答1: Unity Remote 5 is designed to do. It reduces the amount

Access variables/functions from another Component

狂风中的少年 提交于 2019-11-25 23:35:25
问题 So im trying to change a variable in another script by touching a cube. Current setup 1x Player 1x Enemy Each with their own script Enemy_Stats & Character_Stats As you can see in this little snippet it\'s quite a workaround to access the variable from another script. void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag == \"Enemy\") { collision.gameObject.GetComponent<Enemy_Stats>().Health = collision.gameObject.GetComponent<Enemy_Stats>().Health - gameObject