コード例 #1
0
  public static AKRESULT SetMultiplePositions(UnityEngine.GameObject in_GameObjectID, AkPositionArray in_pPositions, ushort in_NumPositions, MultiPositionType in_eMultiPositionType) {
    
		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_SetMultiplePositions__SWIG_0(tempin_GameObjectID, in_pPositions.m_Buffer, in_NumPositions, (int)in_eMultiPositionType);

      return ret;
    }
  }
コード例 #2
0
    public static AKRESULT SetMultiplePositions(UnityEngine.GameObject in_GameObjectID, AkPositionArray in_pPositions, ushort in_NumPositions, MultiPositionType in_eMultiPositionType)
    {
        AkAutoObject tempObj = null;
        uint tempin_GameObjectID = (uint)AutoRegisterAkGameObj(in_GameObjectID, ref tempObj);

        {
          AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetMultiplePositions__SWIG_0(tempin_GameObjectID, in_pPositions.m_Buffer, in_NumPositions, (int)in_eMultiPositionType);

          return ret;
        }
    }
コード例 #3
0
  public static AKRESULT SetMultiplePositions(UnityEngine.GameObject in_GameObjectID, AkPositionArray in_pPositions, ushort in_NumPositions, MultiPositionType in_eMultiPositionType) {
    
		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);
		}
		
		
    {
      AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetMultiplePositions__SWIG_0(tempin_GameObjectID, in_pPositions.m_Buffer, in_NumPositions, (int)in_eMultiPositionType);

      return ret;
    }
  }
コード例 #4
0
    public static AKRESULT SetMultiplePositions(UnityEngine.GameObject in_GameObjectID, AkPositionArray in_pPositions, ushort in_NumPositions, MultiPositionType in_eMultiPositionType)
    {
        AkAutoObject tempObj = null;
        uint tempin_GameObjectID;
        if ( in_GameObjectID != null )
        {
            tempin_GameObjectID = (uint)in_GameObjectID.GetInstanceID();
            if (in_GameObjectID.activeInHierarchy)
            {
                if (in_GameObjectID.GetComponent<AkGameObj>() == null)
                {
                    in_GameObjectID.AddComponent<AkGameObj>();
                }
            }
            else
            {
                //Object not active. AkGameObj will not work.  Use a temporary game object.
                //This will automatically unregister at the end of this scope.
                tempObj = new AkAutoObject(in_GameObjectID);
                tempin_GameObjectID = (uint)tempObj.m_id;	//Silence warning
            }
        }
        else
        {
            tempin_GameObjectID = unchecked((uint)-1);
        }

        {
          AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_SetMultiplePositions__SWIG_0(tempin_GameObjectID, in_pPositions.m_Buffer, in_NumPositions, (int)in_eMultiPositionType);

          return ret;
        }
    }