Unity:the script is an editor script

wenbo228228 2014-12-31 02:23:21
下了个插件,想实现个功能,就在插件官网copy了一个脚本到工程里面参考,结果把脚本往物体上拖,
一开始提示脚本名和类名不一致,我看明明一致嘛!过了会儿估计Unity发现自己看错了,就说:
the script is an editor script,这个什么意思嘛,哪位晓得?
...全文
4443 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
cxy651018139_ 2016-08-17
  • 打赏
  • 举报
回复 1
不要放在editor文件夹下
风飞星闪 2016-08-16
  • 打赏
  • 举报
回复
最后有啥解决方案了吗???
wenbo228228 2015-01-17
  • 打赏
  • 举报
回复
引用 2 楼 wenbo228228 的回复:
[quote=引用 1 楼 candycat1992 的回复:] 它是不是是负责打开某个工具栏命令的脚本,类名上面有menuitem之类的东西?这类脚本不用拖到物体上,它就是全局去增加工具栏里面的命令的,是放下editor文件夹下的
喔[/quote] 脚本是这样的
using UnityEngine;
using System;

public class MyMinimapController : MonoBehaviour
{
	private KGFMapSystem itsKGFMapSystem; // internal reference to the KGFMapSystem
	
	public GameObject itsPlayer1;
	public GameObject itsPlayer2;
	
	public void Start()
	{
		itsKGFMapSystem = KGFAccessor.GetObject<KGFMapSystem>();    //get the KGFMapSystem by using the KGFAccessor class
	}
	
	public void Update()
	{
		if(Input.GetKeyDown(KeyCode.Alpha1))
		{
			if(itsKGFMapSystem != null && itsPlayer1 != null)
			{
				itsKGFMapSystem.SetTarget(itsPlayer1);
			}
		}
		if(Input.GetKeyDown(KeyCode.Alpha2))
		{
			if(itsKGFMapSystem != null && itsPlayer2 != null)
			{
				itsKGFMapSystem.SetTarget(itsPlayer2);
			}
		}
	}
}
不是编辑器脚本,我今天又试了可以拖到物体上,汗……
  • 打赏
  • 举报
回复
the script is an editor script 意思只能在编辑器下面用 里面应该有using UnityEditor 这样的类是无法在发布版游戏里面使用
wenbo228228 2015-01-06
  • 打赏
  • 举报
回复
引用 1 楼 candycat1992 的回复:
它是不是是负责打开某个工具栏命令的脚本,类名上面有menuitem之类的东西?这类脚本不用拖到物体上,它就是全局去增加工具栏里面的命令的,是放下editor文件夹下的
  • 打赏
  • 举报
回复 1
它是不是是负责打开某个工具栏命令的脚本,类名上面有menuitem之类的东西?这类脚本不用拖到物体上,它就是全局去增加工具栏里面的命令的,是放下editor文件夹下的
在O50杀鱼 2021-07-27
  • 举报
回复
@妈妈说女孩子要自立自强 懂了!
- NEW: Created a new layout system. All widgets and panels can now anchor to each other, the screen, and even 3D game objects. - NEW: You can now create resizable scroll views and anchor them to UI elements. - NEW: Re-created the Anchor Example to use the new anchoring system. - NEW: Updated all controls to use the new anchoring system. - NEW: You can now specify an explicit Render Queue on each panel. - NEW: Improved the Text List's functionality, adding support for touch interaction and having a scroll bar. - NEW: Recreated the Chat Window example -- it now features a resizable chat window. - NEW: Recreated the Drag & Drop example, adding two scroll views resized with screen height, and the ability to move items from one to the other. - NEW: Holding CTRL will now show the dimensions of the selected widget in the scene view. - NEW: Resizing the widget now automatically displays width and height guides in the scene view. - NEW: Selected anchored widgets and panels now show the calculated distance in the scene view. - NEW: Widget alpha is now fully cumulative (parents affect children). - NEW: UIDragObject script now ensures that the dragged object remains pixel-perfect. - NEW: UIDragObject script now can restrict the widget from being dragged off-screen. - NEW: Added a script that makes it possible to resize a widget by dragging on its corner or side. - NEW: UICamera.currentScheme tells you the current control scheme -- mouse, touch, or controller. - NEW: Button scripts have been modified to use the new OnDragOver/Out events - NEW: Added an option to the widget anchor to hide itself if it's off-screen. - NEW: Drag Object script now lets you specify an explicit bounds rectangle and has an improved inspector. - NEW: Added a button to UIButtonColor that can automatically replace it with a UIButton. - NEW: Added the ability to copy/paste all values of the sprites and labels via right-click on the component. - NEW: Added a "next page threshold" value to UICenterOnChild for when you want to swipe to move to the next page. - NEW: If the mouse events are off and touch events are on, NGUI will now fake touches using the mouse in the editor. - FIX: Changing panel depth in inspector will now reflect the change correctly. - FIX: Atlas/font selection dialog will now make searching of the entire project optional. - FIX: UICamera events will once again work independently of time scale. - FIX: Fixed the glitch that was causing widgets to jump into the middle of nowhere sometimes when resizing them. - FIX: UIDragScrollView will no longer try to find the scroll view if you set it manually. - FIX: Enabling and disabling textures and Unity 2D sprites will now again set the correct texture. - FIX: Adjusting depths via shortcut keys should now work consistently. - FIX: Draw call viewer will now display the correct triangle count. - FIX: NGUITools.SetActive will now automatically call CreatePanel on widgets, ensuring that there is no frame delay (read: blinking). - FIX: UICamera selected object change should now work multiple times per frame. - FIX: Added a new clause to panel depth comparison that uses panel instance IDs if the panel depth matches (to avoid depth collisions). - FIX: Max line count on labels should now work again. - FIX: Fixed the Drag Objects script on mobile devices. It was not applying momentum properly. - DEL: OnHover is no longer sent via selection changes. Listen to OnSelect and check (UICamera.currentScheme == ControlScheme.Controller). - DEL: "PMA Shader" option is now going to be permanently hidden once the atlas has been created. - DEL: Eliminated the half-pixel offset setting from anchors. - DEL: Removed anchor and stretch scripts from the menus. - NEW: Further improved the layout system's presentation, making it less daunting. - NEW: Enabling anchoring will automatically anchor to the first parent by default. - NEW: It's now possible to automatically anchor to the mid-points (sides, center). - NEW: Made it possible to move and scale anchored widgets. - FIX: Rotating a widget should no longer hide its side handles. - FIX: Mobile keyboard will now have the multi-line option. - FIX: Re-added support for packed fonts.
The complete Visual Behaviour Authoring framework for Unity, empowering you to create advanced AI Behaviours and Logic, including three separate, fully featured, yet seamlessly interchangeable modules for you to choose and easily add in your game: • Behaviour Trees • Hierarchical State Machines • Dialogue Trees NodeCanvas is a production ready framework used by many awesome games including Kim, Pamela, Hurtworld, Shroud of the Avatar, Kingdom and Ghost of a Tale. [Games Showcase] Feature Highlights ------------------------------------- • Choose the right tool for the task at hand. • Design reactive Behaviour Trees and Hierarchical State Machines within an intuitive, designer friendly visual node editor: (Full Undo/Redo, Zoom In/Out, Multi-selection, Duplication, Copy/Pasting, JSON Import/Export, Groups, Comments and more) • Use local & global variables of any type, visually or in code, for creating reusable and actor-oriented, parametric behaviours, optionally saving and loading those variables between gaming sessions. • Data Bind variables with any component property of any type directly. • Sync variables automatically over the network using UNET, for creating multiplayer games. • Visually Debug behaviours with realtime, colorful and informative runtime debugging. • Live Edit everything while in play mode to perfectly understand your design goals and how to achieve them. • Utilize any existing code directly with advanced and extremely fast Reflection Tasks, automatically integrating Unity's and 3rd Party asset APIs. • Work with Lists/Arrays, Enums, Interfaces and pretty much ANY Variable Type you need out-of-the-box. • React to world changes and transfer data using the built-in Event System. • Reuse and Bind made behaviours among any number of different agents. • Organize your designs using Behaviour Sub-Trees and Sub-State Machines. • Extend NodeCanvas Framework to create your own Actions, Conditions, Nodes or even completely new modules with the e
Script Inspector 3 was a finalist in the 2015 Unity Awards! Si3 is an advanced IDE (a Code Editor) for scripts, shaders, and text assets, seamlessly integrated inside the Unity Editor. Si3 comes with context sensitive auto-completion for C# scripts and a rich set of additional tools, key bindings and mouse handling. Si3 will blow your mind – it’s that fast!!! Si3 features a custom made advanced C# parsing and code analysis engine! Thanks to its novel approach to code analysis (a hybrid of .Net’s Reflection and incremental syntactic and semantic analysis techniques) Si3 can easily outperform any other IDE (yes, including Visual Studio!)… Files open instantly! Code changes are reflected instantly in its internal data structures, in the parse tree, and in the type model with symbol tables. Changes are then instantly reflected back to all your scripts… You will enjoy Unity as never before! Programming in Unity now with Si3 is a very smooth, fluent, and pleasant experience. =) Programmers can finally focus on their tasks instead of waiting for (and sometimes fighting with) the external IDE’s to run, load the correct script, or jump to the correct line. Main features: – Automatic code completions for C#, a.k.a intellisense – Customizable code snippets – Code generators for Unity magic methods – Code generators for override methods – Auto-closing braces – Auto-indent – Automated saving and reloading – Quick inspection of static fields and properties – Inspection of MonoBehaviour fields and properties – Easily execute parameterless static methods – Unlimited and independent undo and redo buffers per asset – Quick call-stack navigation to Console log entries – Code symbols and #region navigation – Go To Definition – Find All References with filtering – Unity Scripting Reference – MSDN Reference for .Net symbols – Cursor history navigation – Search / Quick Search / Find in Files – Replace in Files with preview and selections – Global Undo/Redo after Replace in Files – S
QHierarchy is an editor extension that adds several often used functions to hierarchy window: - Displaying the icon of a GameObject - Showing / hiding a GameObject - Locking / unlocking a GameObject - Prevent selection of locked GameObject - Displaying tag and layer of a GameObject - Displaying color label for a GameObject - Displaying the icon of MonoBehaviour script attached to a GameObject - GameObject can be showed / hidden only for edit-time, and the visibility state will return during play-time - Displaying the number of children of a GameObject - Displaying the number of vertices and triangles of the GameObject (can display the number including all children) - Change the colors of icons and labels - Displaying custom icon for any layer - Displaying custom icon for any tag - Displaying prefab connection status - Displaying static flags icon of GameObject - Displaying the error icon (MonoBehaviour script missing / Reference property is null / String property is empty / Callback of event is missing) - Displaying icons of all scripts that attached to a GameObject - Showing / hiding wireframe objects - Enable / Disable MeshRenderer - Order of icons can be changed - Displaying the list of GameObjects in the form of a tree - Option to add right indent (useful if you use other plugins that add another icons to the hierarchy window) - Any feature can be disabled - Source Code Included. Website | Documentation | Contacts Compatible with Unity 4.6.0+ / 5.0.1+ / 2017.1+ / 2018.1+

8,304

社区成员

发帖
与我相关
我的任务
社区描述
游戏开发相关内容讨论专区
社区管理员
  • 游戏开发
  • 呆呆敲代码的小Y
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧