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


C# UnityEngine.GetInstanceID方法代码示例

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


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

示例1: RegisterGameObj

	public static AKRESULT RegisterGameObj(UnityEngine.GameObject in_gameObjectID, string in_pszObjName) {
		AKRESULT res = RegisterGameObjInternal_WithName((int)in_gameObjectID.GetInstanceID(), in_gameObjectID.name);
		if( res == AKRESULT.AK_Success )
		{
			RegisteredGameObjects.Add(in_gameObjectID.GetInstanceID());
		}

		return res;
	}
开发者ID:CalumMcManus,项目名称:Sorcerers-Guild,代码行数:9,代码来源:AkSoundEngine_Windows.cs

示例2: RegisterGameObj

	public static AKRESULT RegisterGameObj(UnityEngine.GameObject in_gameObjectID) {
	
		if (!AkSoundEngine.IsInitialized())
			return AKRESULT.AK_Fail;
			
		AKRESULT res = RegisterGameObjInternal((int)in_gameObjectID.GetInstanceID());
		if( res == AKRESULT.AK_Success )
		{
			RegisteredGameObjects.Add(in_gameObjectID.GetInstanceID());
		}

		return res;
	}
开发者ID:DarrenTsung,项目名称:GGJ2016,代码行数:13,代码来源:AkSoundEngine_Mac.cs

示例3: DynamicSequenceOpen

  public static uint DynamicSequenceOpen(UnityEngine.GameObject in_gameObjectID, uint in_uFlags, AkCallbackManager.EventCallback in_pfnCallback, object in_pCookie) {
    
		uint tempin_gameObjectID;
		if ( in_gameObjectID != null )
		{
			tempin_gameObjectID = (uint)in_gameObjectID.GetInstanceID();
			// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.
			if (in_gameObjectID.GetComponent<AkGameObject>() == null)
			{
				in_gameObjectID.AddComponent<AkGameObject>();
			}
		}
		else
		{
			tempin_gameObjectID = unchecked((uint)-1);
		}
		
		
		in_pCookie = new AkCallbackManager.EventCallbackPackage(in_pfnCallback, in_pCookie);
    {
      uint ret = AkSoundEnginePINVOKE.CSharp_DynamicSequenceOpen__SWIG_1(tempin_gameObjectID, in_uFlags, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode());

      return ret;
    }
  }
开发者ID:Arpit0492,项目名称:Unity,代码行数:25,代码来源:AkSoundEngine_Windows.cs

示例4: Add

 internal static void Add(UnityEngine.Object obj)
 {
     if (obj != null)
     {
         Add(obj.GetInstanceID());
     }
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:7,代码来源:Selection.cs

示例5: GetAssetPreview

		public static Texture2D GetAssetPreview(UnityEngine.Object asset)
		{
			if (asset != null)
			{
				return AssetPreview.GetAssetPreview(asset.GetInstanceID());
			}
			return null;
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:8,代码来源:AssetPreview.cs

示例6: ShowAtPosition

 internal static bool ShowAtPosition(UnityEngine.Object targetObj, Rect activatorRect, bool showLabelIcons)
 {
   int instanceId = targetObj.GetInstanceID();
   bool flag = DateTime.Now.Ticks / 10000L < IconSelector.s_LastClosedTime + 50L;
   if (instanceId == IconSelector.s_LastInstanceID && flag)
     return false;
   Event.current.Use();
   IconSelector.s_LastInstanceID = instanceId;
   if ((UnityEngine.Object) IconSelector.s_IconSelector == (UnityEngine.Object) null)
     IconSelector.s_IconSelector = ScriptableObject.CreateInstance<IconSelector>();
   IconSelector.s_IconSelector.Init(targetObj, activatorRect, showLabelIcons);
   return true;
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:13,代码来源:IconSelector.cs

示例7: RemoveSavedFoldout

 internal static void RemoveSavedFoldout(string uniqueID, UnityEngine.Object target, int index = 0)
 {
     string baseString = "Fold: " + target.GetInstanceID().ToString() + " - " + uniqueID;
     string curString = baseString + index;
     string nextString = baseString + ++index;
     
     while (EditorPrefs.HasKey(nextString))
     {
         bool nextBool = EditorPrefs.GetBool(nextString);
         EditorPrefs.SetBool(curString, nextBool);
         nextString = baseString + ++index;
     }
 }
开发者ID:Bahamutho,项目名称:GJ04-ST.-STELF-EALTH,代码行数:13,代码来源:EditorPlus.cs

示例8: AddUnityReferenceValue

    /** Serializes a Unity Reference. Serializer references such as Transform, GameObject, Texture or other unity objects */
    public override void AddUnityReferenceValue(string key, UnityEngine.Object value)
    {
        //Segment --- Should be identical to a segment in AddUnityReferenceValue/AddValue
        BinaryWriter stream = writerStream;

        AddVariableAnchor (key);

        if (value == null) {
            stream.Write ((byte)0);//Magic number indicating a null reference
            return;
        }

        //Magic number indicating that the data is written and not null
        stream.Write ((byte)1);
        //Segment --- End

        if (value == active.gameObject) {
            stream.Write (-128);//Magic number (random) indicates that the reference is the A* object
        } else if (value == active.transform) {
            stream.Write (-129);
        } else {
            stream.Write (value.GetInstanceID ());
        }
        stream.Write (value.name);

        //Write scene path if the object is a Component or GameObject
        Component component = value as Component;
        GameObject go = value as GameObject;

        if (component == null && go == null) {
            stream.Write ("");
        } else {
            if (go == null) {
                go = component.gameObject;
            }
            string path = go.name;

            while (go.transform.parent != null) {
                go = go.transform.parent.gameObject;
                path = go.name+"/" +path;
            }
            stream.Write (path);
        }

        if (writeUnityReference_Editor != null) {
            stream.Write (true);
            writeUnityReference_Editor (this,value);
        } else {
            stream.Write (false);
        }
    }
开发者ID:jlonardi,项目名称:igp-DnM,代码行数:52,代码来源:AstarSerializer3_07.cs

示例9: LogSingleInstance

        public static void LogSingleInstance(UnityEngine.Object instanceToLog, params object[] toLog)
        {
            int instanceId;

            if (instanceDict.TryGetValue(instanceToLog.GetType(), out instanceId))
            {
                if (instanceId == instanceToLog.GetInstanceID())
                    Log(toLog);
            }
            else
            {
                instanceDict[instanceToLog.GetType()] = instanceToLog.GetInstanceID();
                Log(toLog);
            }
        }
开发者ID:Magicolo,项目名称:PseudoFramework,代码行数:15,代码来源:PDebug.cs

示例10: ShowAtPosition

		internal static bool ShowAtPosition(UnityEngine.Object targetObj, Rect activatorRect, bool showLabelIcons)
		{
			int instanceID = targetObj.GetInstanceID();
			long num = DateTime.Now.Ticks / 10000L;
			bool flag = num < IconSelector.s_LastClosedTime + 50L;
			if (instanceID != IconSelector.s_LastInstanceID || !flag)
			{
				Event.current.Use();
				IconSelector.s_LastInstanceID = instanceID;
				if (IconSelector.s_IconSelector == null)
				{
					IconSelector.s_IconSelector = ScriptableObject.CreateInstance<IconSelector>();
				}
				IconSelector.s_IconSelector.Init(targetObj, activatorRect, showLabelIcons);
				return true;
			}
			return false;
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:18,代码来源:IconSelector.cs

示例11: DynamicSequenceOpen

  public static uint DynamicSequenceOpen(UnityEngine.GameObject in_gameObjectID, uint in_uFlags, AkCallbackManager.EventCallback in_pfnCallback, object in_pCookie) {
    
		uint tempin_gameObjectID;
		if ( in_gameObjectID != null )
		{
			tempin_gameObjectID = (uint)in_gameObjectID.GetInstanceID();
			// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.
			if (in_gameObjectID.GetComponent<AkGameObject>() == null)
			{
				in_gameObjectID.AddComponent<AkGameObject>();

				// Note: We have missed AkGameObject.Awake() of this run to register. 
				// So we take over its work by inlining it here.
				AkSoundEngine.RegisterGameObj(in_gameObjectID, in_gameObjectID.name);
			
				//Set the original position
				AkSoundEngine.SetObjectPosition(
		            in_gameObjectID, 
		            in_gameObjectID.transform.position.x, 
		            in_gameObjectID.transform.position.y, 
		            in_gameObjectID.transform.position.z, 
		            in_gameObjectID.transform.forward.x,
		            in_gameObjectID.transform.forward.y, 
		            in_gameObjectID.transform.forward.z
		        	);
			}
		}
		else
		{
			tempin_gameObjectID = unchecked((uint)-1);
		}
		
		
		in_pCookie = new AkCallbackManager.EventCallbackPackage(in_pfnCallback, in_pCookie);
    {
      uint ret = AkSoundEnginePINVOKE.CSharp_DynamicSequenceOpen__SWIG_1(tempin_gameObjectID, in_uFlags, (IntPtr)0, (IntPtr)in_pCookie.GetHashCode());

      return ret;
    }
  }
开发者ID:juliendeville,项目名称:Lunatic,代码行数:40,代码来源:AkSoundEngine_iOS.cs

示例12: Cache

		public void Cache (UnityEngine.Object obj, float life)
		{
			CacheObject cache = null;
			assetDic.TryGetValue(obj.name, out cache);

			if (cache == null)
			{
				cache = new CacheObject(life);
				cache.id = obj.GetInstanceID();
				cache.objName = obj.name;
				cache.obj = obj;
				cache.remainingLife = life;
				cache.referCount = 1;

				assetDic[cache.objName] = cache;
				indexDic[cache.id] = cache;
			}
			else
			{
				cache.referCount++;
			}
		}
开发者ID:sigmadruid,项目名称:NewMaze,代码行数:22,代码来源:CachePool.cs

示例13: PostEvent

  public static uint PostEvent(string in_pszEventName, UnityEngine.GameObject in_gameObjectID) {
    
		uint tempin_gameObjectID;
		if ( in_gameObjectID != null )
		{
			tempin_gameObjectID = (uint)in_gameObjectID.GetInstanceID();
			// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.
			if (in_gameObjectID.GetComponent<AkGameObject>() == null)
			{
				in_gameObjectID.AddComponent<AkGameObject>();

				// Note: We have missed AkGameObject.Awake() of this run to register. 
				// So we take over its work by inlining it here.
				AkSoundEngine.RegisterGameObj(in_gameObjectID, in_gameObjectID.name);
			
				//Set the original position
				AkSoundEngine.SetObjectPosition(
		            in_gameObjectID, 
		            in_gameObjectID.transform.position.x, 
		            in_gameObjectID.transform.position.y, 
		            in_gameObjectID.transform.position.z, 
		            in_gameObjectID.transform.forward.x,
		            in_gameObjectID.transform.forward.y, 
		            in_gameObjectID.transform.forward.z
		        	);
			}
		}
		else
		{
			tempin_gameObjectID = unchecked((uint)-1);
		}
		
		
    {
      uint ret = AkSoundEnginePINVOKE.CSharp_PostEvent__SWIG_11(in_pszEventName, tempin_gameObjectID);

      return ret;
    }
  }
开发者ID:juliendeville,项目名称:Lunatic,代码行数:39,代码来源:AkSoundEngine_iOS.cs

示例14: ExecuteActionOnEvent

  public static AKRESULT ExecuteActionOnEvent(uint in_eventID, AkActionOnEventType in_ActionType, UnityEngine.GameObject in_gameObjectID, int in_uTransitionDuration) {
    
		uint tempin_gameObjectID;
		if ( in_gameObjectID != null )
		{
			tempin_gameObjectID = (uint)in_gameObjectID.GetInstanceID();
			// Note: if AkGameObjectTracker is already attached, the following code will be bypassed.
			if (in_gameObjectID.GetComponent<AkGameObject>() == null)
			{
				in_gameObjectID.AddComponent<AkGameObject>();

				// Note: We have missed AkGameObject.Awake() of this run to register. 
				// So we take over its work by inlining it here.
				AkSoundEngine.RegisterGameObj(in_gameObjectID, in_gameObjectID.name);
			
				//Set the original position
				AkSoundEngine.SetObjectPosition(
		            in_gameObjectID, 
		            in_gameObjectID.transform.position.x, 
		            in_gameObjectID.transform.position.y, 
		            in_gameObjectID.transform.position.z, 
		            in_gameObjectID.transform.forward.x,
		            in_gameObjectID.transform.forward.y, 
		            in_gameObjectID.transform.forward.z
		        	);
			}
		}
		else
		{
			tempin_gameObjectID = unchecked((uint)-1);
		}
		
		
    {
      AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_ExecuteActionOnEvent__SWIG_2(in_eventID, (int)in_ActionType, tempin_gameObjectID, in_uTransitionDuration);

      return ret;
    }
  }
开发者ID:juliendeville,项目名称:Lunatic,代码行数:39,代码来源:AkSoundEngine_iOS.cs

示例15: AddUnityReferenceValue

        //============== Custom Simpler Serializer
        /** Serializes a Unity Reference. Serializer references such as Transform, GameObject, Texture or other unity objects */
        public virtual void AddUnityReferenceValue(string key, UnityEngine.Object value)
        {
            //Segment --- Should be identical to a segment in AddUnityReferenceValue/AddValue
            BinaryWriter stream = writerStream;

            AddVariableAnchor (key);

            if (value == null) {
                stream.Write ((byte)0);//Magic number indicating a null reference
                return;
            }

            //Magic number indicating that the data is written and not null
            stream.Write ((byte)1);
            //Segment --- End

            if (value == active.gameObject) {
                stream.Write (-128);//Magic number (random) indicates that the reference is the A* object
            } else if (value == active.transform) {
                stream.Write (-129);
            } else {
                stream.Write (value.GetInstanceID ());
            }
            stream.Write (value.name);

            //Write scene path if the object is a Component or GameObject
            Component component = value as Component;
            GameObject go = value as GameObject;

            if (component == null && go == null) {
                stream.Write ("");
            } else {
                if (component != null && go == null) {
                    go = component.gameObject;
                }

                UnityReferenceHelper helper = go.GetComponent<UnityReferenceHelper>();

                if (helper == null) {
                    Debug.Log ("Adding UnityReferenceHelper to Unity Reference '"+value.name+"'");
                    helper = go.AddComponent<UnityReferenceHelper>();
                }

                //Make sure it has a unique GUID
                helper.Reset ();

                stream.Write (helper.GetGUID ());

                /*if (go == null) {
                    go = component.gameObject;
                }
                string path = go.name;

                while (go.transform.parent != null) {
                    go = go.transform.parent.gameObject;
                    path = go.name+"/" +path;
                }
                stream.Write (path);*/
            }

            /*if (writeUnityReference_Editor != null) {
                stream.Write (true);
                writeUnityReference_Editor (this,value);
            } else {*/

                //Backwards compability
                stream.Write (false);
            //}
        }
开发者ID:rmkeezer,项目名称:fpsgame,代码行数:71,代码来源:AstarSerialize.cs


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