unity3d

cmd.exe throws error “& was unexpected at this time.”

痞子三分冷 提交于 2021-02-19 04:18:30
问题 so my problem is that when i just ran cmd.exe in terminal, i get "& was unexpected at this time." Error at the end - looks like this So the problem is that i'm getting erros in Unity 3D when it wants to run the unity_csc.bat file and compile solution. These errors are exactly the same as the one when i just run cmd.exe - therefore i suspect its not an Unity3D based problem (if you want you can check the Unity3D specific thread here https://forum.unity.com/threads/2-empty-errors-in-console-was

cmd.exe throws error “& was unexpected at this time.”

萝らか妹 提交于 2021-02-19 04:15:02
问题 so my problem is that when i just ran cmd.exe in terminal, i get "& was unexpected at this time." Error at the end - looks like this So the problem is that i'm getting erros in Unity 3D when it wants to run the unity_csc.bat file and compile solution. These errors are exactly the same as the one when i just run cmd.exe - therefore i suspect its not an Unity3D based problem (if you want you can check the Unity3D specific thread here https://forum.unity.com/threads/2-empty-errors-in-console-was

cmd.exe throws error “& was unexpected at this time.”

六眼飞鱼酱① 提交于 2021-02-19 04:13:06
问题 so my problem is that when i just ran cmd.exe in terminal, i get "& was unexpected at this time." Error at the end - looks like this So the problem is that i'm getting erros in Unity 3D when it wants to run the unity_csc.bat file and compile solution. These errors are exactly the same as the one when i just run cmd.exe - therefore i suspect its not an Unity3D based problem (if you want you can check the Unity3D specific thread here https://forum.unity.com/threads/2-empty-errors-in-console-was

Unity: Difference between Audio Source, Audio Listener and Audio Clip

房东的猫 提交于 2021-02-18 22:34:26
问题 I would like to play some sound effects in my Unity project. I looked for a solution on the official website but I could not get the difference between an Audio Source, an Audio Listener and an Audio Clip. Is it better to add them programmatically or to use an appropriate component? Thank you in advance for your patience. 回答1: An AudioSource is a component that allows for sound to be played in your scene. It also holds the control options for the audio like Play Pause volume loop and all

Shader that transforms a mercator projection to equirectangular?

早过忘川 提交于 2021-02-18 16:55:14
问题 I am trying to make a shader in Unity taking a mercator projection texture as a source and converting it to an equirectangular projection texture . Input example: Output example: This example does the opposite with an equirectangular as source. If you look at the source of the above example: // mercator float latClamped = clamp(lat, -1.4835298641951802, 1.4835298641951802); float yMerc = log(tan(PI / 4.0 + latClamped / 2.0)) / PI2; float xMerc = xEqui / 2.0; vec4 mercatorPos = vec4(xMerc,

Unity编辑器的扩展:IMGUI

僤鯓⒐⒋嵵緔 提交于 2021-02-18 12:29:04
IMGUI 介绍 所有关于 Editor 的相关 UI,包括 Inspector、Hierarchy、Window、Game 视图上动态创建的那些半透明 UI、还有 Scene 视图上可添加的辅助显示 UI,叫做 IMGUI,全称 Immediate Mode GUI 。该名字来源于两类型的 UI 系统: immediate 和 retained 。 retained:当你设置好各种组件如 Text、Button 等的信息,或修改它们的相关属性后,这些组件的相关信息和改动就被保存(retained)下来了,系统会根据这些新的信息来绘制响应事件等,你可以随时去查询如 Text 文本内容或颜色等信息。UGUI 即是典型的 retained mode GUI。 immediate:跟上面的相反,系统不会自动保存 UI 控件上的各种信息,不会用上次的状态继续工作,而是反复的询问你这些控件应当是处于什么位置什么文本等状态信息。因此任何的用户交互结果是立即呈现返回给用户,而不是当用户需要的时候自行查询。如: 1 bool selected = false ; 2 void OnGUI() 3 { 4 selected = GUILayout.Toggle(selected, " A Toggle text " ); 5 if (selected) 6 { 7 DoSomething() 8 }

C# Why shouldn't I ever use coroutines?

倖福魔咒の 提交于 2021-02-18 12:20:07
问题 One of the comments on this thread: Checking condition and calling continuous method with periods of delay unity, said that: Never never ever use coroutines. They teach bad habits from the point of view as a c# developer and will lead to a lynching if you take a regular c# job My question is, why is this? Is this just in Unity or in general? Unity's official virtual reality samples https://www.assetstore.unity3d.com/en/#!/content/51519 use them very heavily (especially the flyer example)

Write Unity IOS plugin in Swift code

こ雲淡風輕ζ 提交于 2021-02-18 10:56:17
问题 Is it possible to write unity IOS plugin in Swift? I already have a working swift framework and want to use it as a plugin in Unity I saw some places which say it can only be done on Objective-c but is there a workaround for swift? 回答1: How to call Unity methods Unity interface functions are defined in UnityInterface.h in Xcode project built by Unity. This header file is imported in UnitySwift-Bridging-Header.h , so you can call the functions directly in your Swift codes. To call Unity

Write Unity IOS plugin in Swift code

佐手、 提交于 2021-02-18 10:56:11
问题 Is it possible to write unity IOS plugin in Swift? I already have a working swift framework and want to use it as a plugin in Unity I saw some places which say it can only be done on Objective-c but is there a workaround for swift? 回答1: How to call Unity methods Unity interface functions are defined in UnityInterface.h in Xcode project built by Unity. This header file is imported in UnitySwift-Bridging-Header.h , so you can call the functions directly in your Swift codes. To call Unity

UGUI的图集处理方式-SpriteAtlas的前世今生

杀马特。学长 韩版系。学妹 提交于 2021-02-18 03:51:57
最糟糕的是人们在生活中经常受到错误志向的阻碍而不自知,真到摆脱了那些阻碍时才能明白过来。 —— 歌德 说到UGUI的图集初学者可能觉得没什么难度,包括我刚开始接触的时候也是,甚至你在开发的时候只需要把图片导入到项目中,拖拖拽拽就能做出能用的东西来。因为UGUI刚出的时候就打出了“Unity会自动帮你维护图集”的旗号。可现实真的是这样的吗?要解释这个问题就需要从Unity4.6说起了,那我们来捋一下! Sprite Packer 散图的加载问题 这功能是从Unity4.6版本随着UGUI的问世一起发布的,我们在做开发的时候只需要把图片导入工程,设置一下,然后在通过tag标签Unity就会自动打成图集。但是,这种方法有个问题,就是我们在运行时无法通过代码取出某张图集中的一张小图。 所以后来开发者们做了一套prefab引用sprite的解决方案,做法就是:建一个空prefab挂一个自定义脚本,脚本里有一个sprite数组,我们在编辑时把要打的图集中的sprite添加到这个sprite数组中,然后在把prefab打成bundle,这样这个bundle中的脚本就会有atlas中的Sprite的引用,我们在脚本里写一个GetSprite方法即可。这样我们在运行时加载完bundle后就可以通过脚本取出atlas里的sprite。 using System.Collections.Generic