本文整理汇总了C#中UnityEngine.Object类的典型用法代码示例。如果您正苦于以下问题:C# Object类的具体用法?C# Object怎么用?C# Object使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Object类属于UnityEngine命名空间,在下文中一共展示了Object类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Create
public static GenericDisplayedBioBrick Create(
Transform parentTransform
,Vector3 localPosition
,string spriteName
,BioBrick biobrick
,Object externalPrefab = null
)
{
string usedSpriteName = ((spriteName!=null)&&(spriteName!=""))?spriteName:getSpriteName(biobrick);
string nullSpriteName = ((spriteName!=null)&&(spriteName!=""))?"":"(null)=>"+usedSpriteName;
if(genericPrefab == null) genericPrefab = Resources.Load(prefabURI);
Object prefabToUse = (externalPrefab==null)?genericPrefab:externalPrefab;
Logger.Log("GenericDisplayedBioBrick::Create(parentTransform="+parentTransform
+ ", localPosition="+localPosition
+ ", spriteName="+spriteName+nullSpriteName
+ ", biobrick="+biobrick
, Logger.Level.TRACE
);
GenericDisplayedBioBrick result = (GenericDisplayedBioBrick)DisplayedElement.Create(
parentTransform
,localPosition
,usedSpriteName
,prefabToUse
);
Initialize(result, biobrick);
return result;
}
开发者ID:CyberCRI,项目名称:Hero.Coli,代码行数:33,代码来源:GenericDisplayedBioBrick.cs
示例17: OnGUI
public override void OnGUI(Object actionObj)
{
LoadSceneAction action = actionObj as LoadSceneAction;
if (action == null) { GUILayout.Label("Error: Delete this Action."); return; }
EditorGUILayout.BeginHorizontal();
{
GUILayout.Label("Load");
EditorGUILayout.Space();
EditorGUILayout.BeginVertical();
{
action.loadBy = EditorGUILayout.Popup(action.loadBy, options);
if (action.loadBy == 0)
{
action.gameSceneIdx = EditorGUILayout.Popup(action.gameSceneIdx, UniRPGEditorGlobal.DB.gameSceneNames.ToArray());
UniRPGEdGui.LookLikeControls();
action.num = UniRPGEdGui.GlobalNumericVarOrValueField(this.ed, "SpawnPoint Ident", action.num, 120);
EditorGUILayout.Space();
EditorGUILayout.HelpBox("The 'SpawnPoint Ident' is the unique identifier number you entered for the SpawnPoint. Leave this at (-1) if you want UniRPG to use the first available Player Spawn point or use the world center.", MessageType.Info);
}
else if (action.loadBy == 1)
{
// no options
}
else if (action.loadBy == 2)
{
action.sceneName = UniRPGEdGui.GlobalStringVarOrValueField(this.ed, null, action.sceneName);
}
}
EditorGUILayout.EndVertical();
}
EditorGUILayout.EndHorizontal();
}
开发者ID:voidserpent,项目名称:rpgbase,代码行数:33,代码来源:LoadSceneAction_Ed.cs
示例18: BuildNavMeshForMultipleScenes
/// <summary>
/// <para>Builds the combined navmesh for the contents of multiple scenes.</para>
/// </summary>
/// <param name="paths">Array of paths to scenes that are used for building the navmesh.</param>
public static void BuildNavMeshForMultipleScenes(string[] paths)
{
if (paths.Length == 0)
return;
for (int index1 = 0; index1 < paths.Length; ++index1)
{
for (int index2 = index1 + 1; index2 < paths.Length; ++index2)
{
if (paths[index1] == paths[index2])
throw new Exception("No duplicate scene names are allowed");
}
}
if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
return;
if (!EditorSceneManager.OpenScene(paths[0]).IsValid())
throw new Exception("Could not open scene: " + paths[0]);
for (int index = 1; index < paths.Length; ++index)
EditorSceneManager.OpenScene(paths[index], OpenSceneMode.Additive);
NavMeshBuilder.BuildNavMesh();
UnityEngine.Object sceneNavMeshData = NavMeshBuilder.sceneNavMeshData;
for (int index = 0; index < paths.Length; ++index)
{
if (EditorSceneManager.OpenScene(paths[index]).IsValid())
{
NavMeshBuilder.sceneNavMeshData = sceneNavMeshData;
EditorSceneManager.SaveScene(SceneManager.GetActiveScene());
}
}
}
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:33,代码来源:NavMeshBuilder.cs
示例19: ActionShortNfo
public override string ActionShortNfo(Object actionObj)
{
SkillChangeAction action = actionObj as SkillChangeAction;
if (action == null) return "!ERROR!";
if (action.skillPrefab) return string.Format("{0} Skill ({1}) on {2}", (action.addSkill ? "Add" : "Remove"), action.skillName, action.subject.type);
else return string.Format("Add/Remove Skill (!ERROR!) on {0}", action.subject.type);
}
开发者ID:fvivaudo,项目名称:Rush01,代码行数:7,代码来源:SkillChangeAction_Ed.cs
示例20: LogPerf
/// <summary>
/// Helper function so we can disable logging
/// </summary>
public static void LogPerf( Object context, string message, params object[] parms )
{
#if UNITY_EDITOR
if ( AmsPreferences.PerfLogging )
#endif
Debug.LogFormat( context, "Ams Perf: " + message, parms );
}
开发者ID:santiamchristian,项目名称:compro2016,代码行数:10,代码来源:AmsDebug.cs
注:本文中的UnityEngine.Object类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论