unity-editor

How to create an illustrator/photoshop-like pentool for creating bezier curves in Unity

僤鯓⒐⒋嵵緔 提交于 2020-01-14 07:26:08
问题 I need to create complex segmented bezier curves so I want update the code to create illustrator/photoshop-like pen tool bezier curves. This video shows how the pentool behaves. Please note that instead of creating a quadratic bezier curve with the first two anchor points (as shown in the video) I would rather prefer a cubic (as in the linked code example). The following are features I've realised of the illustrator/photoshop pen tool that are necessary for replication in Unity. all anchor

Prefab Mode only Adjusts one game object until the others are manually selected in hierarchy window

北慕城南 提交于 2019-12-29 09:33:08
问题 I created a bezier curve with the code below and made a prefab of the bezier curve. I added a few copies of the prefab to my scene. When I open the original prefab in prefab mode (I am using Unity 2019.1.0a8 ) and adjust any of the points it only affects one of the prefabs, the changes are not recognised in the scene view till I select the other objects manually. Please note that each of the prefab copies is rotated to an angle different from the original prefab. Before I rotate the copies

Scene view cannot recognise movement of several objects in the editor until objects are selected

匆匆过客 提交于 2019-12-24 21:25:48
问题 I created a game object and added a SpriteStuff script to it that I created with a various properties and functions for the game object. I also made a few copies of the object. After, I made a GroupSpriteStuff game object which has the following property public List<SpriteStuff> spriteStuffs; I added an editor script for GroupSpriteStuff ( GroupSpriteStuffEditor ) that iterates through spriteStuffs to move each object using a slider. The movement of objects in spriteStuffs is only seen when I

How to select elements in nested ReorderableList in a CustomEditor?

十年热恋 提交于 2019-12-18 04:48:11
问题 I have a ReorderableList in my CustomEditor script. In the drawElementCallback I added a second nested ReorderableList . Everything works fine and I can add elements to both lists like here BUT as you can see for some reason I can not select the elements of the inner ReorderableList s so I also can not remove items. How can I select items in the inner list? Here the classes broken down to the basic example using System; using System.Collections.Generic; using UnityEditor; using

how to clone several game objects in a way that clone properties of one can be adjusted to match all others in scene view

不问归期 提交于 2019-12-17 20:43:20
问题 I asked How can I adjust shape/dimensions of one clone to affect all other clones in the scene view and the accepted answer was spot on. It could only clone one game object. I tried making some adjustments but the only solution I came up with was adding duplicate methods for additional objects. This doesn't work well when dealing with several game objects to be cloned. How can I clone several unique game objects so that adjusting the components/properties of one clone would affect all other

How can I color a PrefixLabel in Unity Editor?

南楼画角 提交于 2019-12-13 03:57:00
问题 My question is that simple: I just want to be able to use EditorGUILayout.PrefixLabel but change the text color to white. But so far I have no luck. I can easely change the color of all other elements but for the PrefixLabel nothing is working. I want to stick with PrefixLabel since it simply is less code to have all labels and fields arranged well. A fiew things I tried so far: using EditorStyles.label.normal.textColor var old = EditorStyles.label.normal.textColor; EditorStyles.label.normal

Editor Window screenshot

 ̄綄美尐妖づ 提交于 2019-12-11 03:27:02
问题 I want to capture a screenshot from a custom EditorWindow that I'm using as a LevelEditor for a game I'm working on, but i'm not sure on how to do it. What I want is to capture the EditorWindow, NOT the game view or the scene view. Can you help me? Thanks! Edit: I want to take screenshots by code, when pressing a GUILayout.Button :) 回答1: I made a script for this using InternalEditorUtility.ReadScreenPixel . At first I actually had it as you requested on a GUILayout.Button but decided to

How to have custom script icons other than using “Assets/Gizmos” in Unity3D

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 17:00:39
问题 I know this was asked a lot of times probably .. but it is very often answered wrong. What I want is: Use a custom icon for specific components/scripts in the Inspector (e.g. Figure 2 and Figure 3) and the ProjectView (e.g. Figure 1) What I do so far: For each component/class that shall have the icon I have an accroding Icon file in the folder Assets/Gizmos/<Path>/<To>/<Namespace>/<ClassName> icon and in the Import Settigns set TextureType to Editor GUI and Legacy GUI This is working fine ..

How can I adjust shape/dimensions of one clone to affect all other clones in the scene view

心已入冬 提交于 2019-12-01 05:53:16
I would like to change/adjust the shape/dimensions of several cloned objects within the scene view by adjusting one. This object could be say a quad or a line renderer that needs to be extended. For example as one game objects line renderer is extended (using the mouse) in the scene view, all other clones are affected. I know that it's a lot simpler to adjust shape/dimensions of one object before cloning it, also this change can be made on a prefab and applied to all, but I need to see the dynamic changes as they happen to make my design process more effective. I would also like to turn this

How can I adjust shape/dimensions of one clone to affect all other clones in the scene view

江枫思渺然 提交于 2019-12-01 02:55:57
问题 I would like to change/adjust the shape/dimensions of several cloned objects within the scene view by adjusting one. This object could be say a quad or a line renderer that needs to be extended. For example as one game objects line renderer is extended (using the mouse) in the scene view, all other clones are affected. I know that it's a lot simpler to adjust shape/dimensions of one object before cloning it, also this change can be made on a prefab and applied to all, but I need to see the