当前位置: 首页>>代码示例>>C#>>正文


C# UnityEngine.Object类代码示例

本文整理汇总了C#中UnityEngine.Object的典型用法代码示例。如果您正苦于以下问题:C# Object类的具体用法?C# Object怎么用?C# Object使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Object类属于UnityEngine命名空间,在下文中一共展示了Object类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnGUI

	public override void OnGUI(Object actionObj)
	{
		StateChangeAction action = actionObj as StateChangeAction;
		if (action == null) { GUILayout.Label("Error: Delete this Action."); return; }

		EditorGUILayout.BeginHorizontal();
		{
			action.setState = (0 == EditorGUILayout.Popup((action.setState ? 0 : 1), options));
			UniRPGEdGui.TargetTypeField(this.ed, "on", action.subject, TargetTypeHelp);
			GUILayout.FlexibleSpace();
		}
		EditorGUILayout.EndHorizontal();
		GUILayout.Space(15);

		scroll = UniRPGEdGui.BeginScrollView(scroll, UniRPGEdGui.ScrollViewNoTLMarginStyle, GUILayout.Height(200));
		for (int i = 0; i < UniRPGEditorGlobal.DB.states.Count; i++)
		{
			if (UniRPGEdGui.ToggleButton(UniRPGEditorGlobal.DB.states[i] == action.state, UniRPGEditorGlobal.DB.states[i].screenName, EditorStyles.miniButton, UniRPGEdGui.ButtonOnColor, GUILayout.Width(270)))
			{
				action.state = UniRPGEditorGlobal.DB.states[i];
			}
		}
		UniRPGEdGui.EndScrollView();
		showAcceptButton = (action.state != null);
	}
开发者ID:fvivaudo,项目名称:Rush01,代码行数:25,代码来源:StateChangeAction_Ed.cs

示例2: ActionShortNfo

	public override string ActionShortNfo(Object actionObj)
	{
		DebugLogAction action = actionObj as DebugLogAction;
		if (action == null) return "!ERROR!";
		if (action.inclNum) return string.Format("Debug: {0} ({1})", action.text.GetValOrName(), action.num.GetValOrName());
		else return string.Format("Debug: {0}", action.text.GetValOrName());
	}
开发者ID:voidserpent,项目名称:rpgbase,代码行数:7,代码来源:DebugLogAction_Ed.cs

示例3: Object

 public override UnityObject Object(GUIContent content, UnityObject value, System.Type type, bool allowSceneObjects, Layout option)
 {
     // If we pass an empty content, ObjectField will still reserve space for an empty label ~__~
     return string.IsNullOrEmpty(content.text) ?
         EditorGUILayout.ObjectField(value, type, allowSceneObjects, option) :
         EditorGUILayout.ObjectField(content, value, type, allowSceneObjects, option);
 }
开发者ID:tng2903,项目名称:DanmakU,代码行数:7,代码来源:TurtleGUI.cs

示例4: ActionShortNfo

	public override string ActionShortNfo(Object actionObj)
	{
		StateChangeAction action = actionObj as StateChangeAction;
		if (action == null) return "!ERROR!";
		if (action.state) return string.Format("{0} State ({1}) on {2}", (action.setState ? "Set" : "Clear"), action.state.screenName, action.subject.type);
		else return string.Format("Set/Clear State (!ERROR!) on {0}", action.subject.type);
	}
开发者ID:fvivaudo,项目名称:Rush01,代码行数:7,代码来源:StateChangeAction_Ed.cs

示例5: Register

 public void Register( Object owner, Action action )
 {
     actionList.AddLast( new EventSubscriber {
         action = action,
         owner = owner
     } );
 }
开发者ID:OrangeeZ,项目名称:Crandell,代码行数:7,代码来源:AutoReleaseEvent.cs

示例6: Initialize

 public override void Initialize(Object[] targets)
 {
   base.Initialize(targets);
   this.GetNetworkInformation(this.target as NetworkManager);
   this.m_ShowServerMessagesLabel = new GUIContent("Server Message Handlers:", "Registered network message handler functions");
   this.m_ShowClientMessagesLabel = new GUIContent("Client Message Handlers:", "Registered network message handler functions");
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:7,代码来源:NetworkManagerPreview.cs

示例7: GetAssetPath

        /// <summary>
        /// Gets the asset path of a object.
        /// </summary>
        /// <returns>The asset path.</returns>
        /// <param name="obj">Object.</param>
        public static string GetAssetPath(Object obj)
        {
            if (obj == null)
                return string.Empty;

            return AssetDatabase.GetAssetPath(obj);
        }
开发者ID:penspanic,项目名称:Mawang,代码行数:12,代码来源:SPTools.cs

示例8: ActionShortNfo

	public override string ActionShortNfo(Object actionObj)
	{
		SoundAction action = actionObj as SoundAction;
		if (action.doWhat == 0) return "Start Sound or Music";
		if (action.doWhat == 1) return "Play Target Sound";
		return "Stop Target Sound";
	}
开发者ID:voidserpent,项目名称:rpgbase,代码行数:7,代码来源:SoundAction_Ed.cs

示例9: ActionShortNfo

	public override string ActionShortNfo(Object actionObj)
	{
		SendMessageAction action = actionObj as SendMessageAction;
		if (action == null) return "!ERROR!";
		if (action.sendToTaggedObjects) return string.Format("SendMessage ({0}) to all with tag: {1}", action.functionName, action.tagToUse);
		else return string.Format("SendMessage ({0}) to: {1}", action.functionName, action.subject);
	}
开发者ID:voidserpent,项目名称:rpgbase,代码行数:7,代码来源:SendMessageAction_Ed.cs

示例10: UniqueObject

		public UniqueObject( Object obj )
		{
#if USE_STRONG_EDITOR_REFS
			editorLocalId = 0;
#endif

			scene = new AmsSceneReference();
			fullPath = string.Empty;
			componentName = string.Empty;
			version = CurrentSerializedVersion;
			componentIndex = 0;

			if ( !obj )
				return;

			GameObject gameObject = GameObjectEx.EditorGetGameObjectFromComponent( obj );
			if ( gameObject )
			{
				scene = new AmsSceneReference( gameObject.scene );
				fullPath = gameObject.GetFullName();

				Component comp = obj as Component;
				if ( comp )
				{
					componentName = obj.GetType().AssemblyQualifiedName;
					gameObject.GetComponents( obj.GetType(), _reusableComponentsList );
					componentIndex = _reusableComponentsList.IndexOf( comp );
				}
			}

#if USE_STRONG_EDITOR_REFS
			editorLocalId = GetEditorId( obj );
#endif
		}
开发者ID:santiamchristian,项目名称:compro2016,代码行数:34,代码来源:UniqueObjectEditorEx.cs

示例11: RegisterCreatedObjectUndo

		public static void RegisterCreatedObjectUndo(Object obj, string msg)
		{
			#if PB_DEBUG
			Debug.Log("RegisterCreatedObjectUndo()  ->  " + msg);
			#endif
			Undo.RegisterCreatedObjectUndo(obj, msg);
		}
开发者ID:itubeasts,项目名称:I-eaT-U,代码行数:7,代码来源:pbUndo.cs

示例12: DestroyImmediate

		/**
		 * Record object prior to deletion.
		 */
		public static void DestroyImmediate(Object obj, string msg)
		{
			#if PB_DEBUG
			Debug.Log("DestroyImmediate()  ->  " + msg);
			#endif
			Undo.DestroyObjectImmediate(obj);
		}
开发者ID:itubeasts,项目名称:I-eaT-U,代码行数:10,代码来源:pbUndo.cs

示例13: RegisterCompleteObjectUndo

		/**
		 * Undo.RegisterCompleteObjectUndo
		 */
		public static void RegisterCompleteObjectUndo(Object[] objs, string msg)
		{
			#if PB_DEBUG
			Debug.Log("RegisterCompleteObjectUndo()  ->  " + msg);
			#endif
			Undo.RegisterCompleteObjectUndo(objs, msg);
		}
开发者ID:itubeasts,项目名称:I-eaT-U,代码行数:10,代码来源:pbUndo.cs

示例14: RecordObject

		/**
		 * Record an object for Undo.
		 */
		public static void RecordObject(Object obj, string msg)
		{
			#if PB_DEBUG
			Debug.Log("RecordObject()  ->  " + msg);
			#endif
			Undo.RecordObject(obj, msg);
		}
开发者ID:itubeasts,项目名称:I-eaT-U,代码行数:10,代码来源:pbUndo.cs

示例15: CopyAndRenameAsset

        public static bool CopyAndRenameAsset(Object obj, string newName, string newFolderPath)
        {
            #if UNITY_EDITOR
            string path = newFolderPath;

            if(path[path.Length - 1] != '/')
                path += "/";
            string testPath = path.Remove(path.Length - 1);

            //			if(AssetDatabase.IsValidFolder(testPath) == false)
            //			{
            //				Debug.LogError("This folder does not exist " + testPath);
            //				return false;
            //			}

            string assetPath =  AssetDatabase.GetAssetPath(obj);
            string fileName = GetFileName(assetPath);
            string extension = fileName.Remove(0, fileName.LastIndexOf('.'));

            string newFileName = path + newName + extension;

            if(System.IO.File.Exists(newFileName))
                return false;

            return AssetDatabase.CopyAsset(assetPath, newFileName);
            #else
            return false;

            #endif
        }
开发者ID:thetobinator,项目名称:udg2,代码行数:30,代码来源:FBXExporter.cs


注:本文中的UnityEngine.Object类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。