RegisterGameObj() public static method

public static RegisterGameObj ( UnityEngine in_gameObjectID ) : AKRESULT
in_gameObjectID UnityEngine
return AKRESULT
示例#1
0
    // private List<IDisposable> _backgroundSubscriptions;

    // private ItemInstance _dragItem;
    // private Transform[] _dragCells;
    // private Vector2[] _dragOffsets;
    // private int2 _dragCellOffset;
    // private ItemRotation _originalRotation;
    // //private Shape _previousFakeOccupancy;
    // private Shape _originalOccupancy;
    // private EquippedItem _originalEquippedItem;
    // private InventoryPanel _originalPanel;
    //
    // private InventoryPanel _dragTargetPanel;
    // private int2 _dragTargetPosition;
    // private int2 _lastDragPosition;
    // private bool _dragTargetValid;
    // private bool _destroyItem;

    private void OnEnable()
    {
        AkSoundEngine.RegisterGameObj(gameObject);
        // Background.gameObject.SetActive(true);

        // Background.OnEnter.Subscribe(enter =>
        // {
        //     _destroyItem = true;
        // });
        // BackgroundExited.OnPointerExitAsObservable().Subscribe(enter =>
        // {
        //     _destroyItem = false;
        // });
        var cargo = GameManager.DockingBay ?? GameManager.CurrentEntity.CargoBays.FirstOrDefault();

        if (cargo != null)
        {
            InventoryPanels[0].Display(cargo);
        }
        else
        {
            InventoryPanels[0].Clear();
        }
        if (GameManager.CurrentEntity != null)
        {
            InventoryPanels[1].Display(GameManager.CurrentEntity);
        }
        else
        {
            InventoryPanels[1].Clear();
        }
    }
示例#2
0
    void Start()
    {
        AkSoundEngine.RegisterGameObj(this.gameObject);

        // validate lighting options
        if (useTimer)
        {
            if (litTimeMinimum <= 0.0f)
            {
                litTimeMinimum = 5.0f;
            }

            if (litTimeMaximum <= 0.0f || litTimeMaximum < litTimeMinimum)
            {
                litTimeMaximum = litTimeMinimum + 5.0f;
            }
        }

        // set litness state
        if (startLit)
        {
            Light();
        }
        else
        {
            Unlight();
        }
    }
示例#3
0
    private void Awake()
    {
        if (!this.isStaticObject)
        {
            this.m_posData = new AkGameObjPositionData();
        }
        Collider component = base.GetComponent <Collider>();

        this.coll = component;
        if (component != null)
        {
            this.GameObjColliderBounds = base.GetComponent <Collider>().bounds;
            component.enabled          = false;
        }
        AKRESULT aKRESULT = AkSoundEngine.RegisterGameObj(base.gameObject, base.gameObject.name, (uint)(this.listenerMask & 255));

        if (aKRESULT == AKRESULT.AK_Success)
        {
            Vector3 position = this.GetPosition();
            AkSoundEngine.SetObjectPosition(base.gameObject, position.x, position.y, position.z, base.transform.forward.x, base.transform.forward.y, base.transform.forward.z);
            if (this.isEnvironmentAware)
            {
                this.m_envData = new AkGameObjEnvironmentData();
                this.AddAuxSend(base.gameObject);
            }
        }
    }
示例#4
0
    void Start()
    {
        // TODO use boolean & choose to fade in from black or fade in from purple

        AkSoundEngine.RegisterGameObj(this.gameObject);
        m_currentHealth = m_maxHealth;
        UpdateHUD();
    }
示例#5
0
    void Awake()
    {
        AkSoundEngine.RegisterGameObj(this.gameObject);

        navMeshAgent    = GetComponent <NavMeshAgent>();
        playerReference = GameObject.Find("[VRTK_SDKManager]/[VRTK_SDKSetups]/SteamVR/[CameraRig]/Player");
        meshColor       = meshReferences[0].GetComponent <SkinnedMeshRenderer>().material.color;
    }
示例#6
0
 void Start()
 {
     {
         // Initialize State so it doesn't default to None State
         //AkSoundEngine.SetState("Hats", "Hat1");
         AkSoundEngine.RegisterGameObj(gameObject);
         AkSoundEngine.SetSwitch("HatSwitch", "Hat1", gameObject);
     }
 }
示例#7
0
    public AKRESULT Register()
    {
        if (isRegistered)
        {
            return(AKRESULT.AK_Success);
        }

        isRegistered = true;
        return(AkSoundEngine.RegisterGameObj(gameObject, gameObject.name));
    }
示例#8
0
    public override void Awake()
    {
        base.Awake();
        this.Serialize         = false;
        this.EnabledWhenPaused = false;

        // Register a Game Object in the sound engine, with its name.
        AkSoundEngine.RegisterGameObj(this.Entity, this.Entity.ToString());
        this.Update();
    }
示例#9
0
    void Awake()
    {
#if UNITY_EDITOR
        if (AkUtilities.IsMigrating)
        {
            return;
        }
#endif

        // If the object was marked as static, don't update its position to save cycles.
#if UNITY_EDITOR
        if (!UnityEditor.EditorApplication.isPlaying)
        {
            UnityEditor.EditorApplication.update += this.CheckStaticStatus;
            return;
        }
#endif
        if (!isStaticObject)
        {
            m_posData = new AkGameObjPositionData();
        }

        // Cache the bounds to avoid calls to GetComponent()
        m_Collider = GetComponent <Collider>();

        //Register a Game Object in the sound engine, with its name.
        AKRESULT res = AkSoundEngine.RegisterGameObj(gameObject, gameObject.name, (uint)(listenerMask & ALL_LISTENER_MASK));
        if (res == AKRESULT.AK_Success)
        {
            // Get position with offset
            Vector3 position = GetPosition();

            //Set the original position
            AkSoundEngine.SetObjectPosition(
                gameObject,
                position.x,
                position.y,
                position.z,
                transform.forward.x,
                transform.forward.y,
                transform.forward.z,
                transform.up.x,
                transform.up.y,
                transform.up.z);

            if (isEnvironmentAware)
            {
                m_envData = new AkGameObjEnvironmentData();
                //Check if this object is also an environment.
                AddAuxSend(gameObject);
            }
        }
    }
示例#10
0
    private void OnEnableEditorListener()
    {
        if (!Application.isPlaying && AkSoundEngine.IsInitialized())
        {
            AkSoundEngine.RegisterGameObj(gameObject, gameObject.name);

            var id = AkSoundEngine.GetAkGameObjectID(gameObject);
            AkSoundEnginePINVOKE.CSharp_AddDefaultListener(id);

            UnityEditor.EditorApplication.update += UpdateEditorListenerPosition;
        }
    }
示例#11
0
        /// <summary>
        /// 创建一个指定的全局游戏wwise对象
        /// </summary>
        public void CreateWwisGameobject(string name)
        {
            GameObject wwiseGameObjct = GameObject.Find(name);

            if (wwiseGameObjct != null)
            {
                return;
            }
            wwiseGameObjct = new GameObject(name);
            wwiseGameObjct.AddComponent <DontDestroyOnLoad>();
            AkSoundEngine.RegisterGameObj(wwiseGameObjct);
            wwiseGameObjectDic.Add(name, wwiseGameObjct);
        }
示例#12
0
    private void PlayIncidental(float force, Collider i)
    {
        var incidentalEventRef = (IncidentalAudio)i.gameObject.GetComponent(typeof(IncidentalAudio));

        if (incidentalEventRef != null)
        {
            AkSoundEngine.RegisterGameObj(i.gameObject);
            AkSoundEngine.SetRTPCValue("RTPC_Incidental_Delay", GetIncidentalDifference(i.gameObject).Item1, i.gameObject);
            AkSoundEngine.SetRTPCValue("RTPC_Incidental", 1.0f - (force / SphereOverlapRadius), i.gameObject);

            AkSoundEngine.PostEvent(incidentalEventRef.EventName, i.gameObject);
        }
    }
示例#13
0
    void Start()
    {
        AkSoundEngine.RegisterGameObj(this.gameObject);

        //make sure the object has the VRTK script attached...
        if (weaponParent.GetComponent <VRTK_InteractableObject>() == null)
        {
            Debug.LogError("Team3_Interactable_Object_Extension is required to be attached to an Object that has the VRTK_InteractableObject script attached to it");
            return;
        }
        //subscribe to the event.  NOTE: the "ObectGrabbed"  this is the procedure to invoke if this object is grabbed
        weaponParent.GetComponent <VRTK_InteractableObject>().InteractableObjectGrabbed   += new InteractableObjectEventHandler(ObjectGrabbed);
        weaponParent.GetComponent <VRTK_InteractableObject>().InteractableObjectUngrabbed += new InteractableObjectEventHandler(ObjectUngrabbed);
    }
示例#14
0
    void Awake()
    {
#if UNITY_EDITOR
        if (AkUtilities.IsMigrating)
        {
            return;
        }

        // If the object was marked as static, don't update its position to save cycles.
        if (!UnityEditor.EditorApplication.isPlaying)
        {
            UnityEditor.EditorApplication.update += this.CheckStaticStatus;
            return;
        }
#endif
        if (!isStaticObject)
        {
            m_posData = new AkGameObjPositionData();
        }

        // Cache the bounds to avoid calls to GetComponent()
        m_Collider = GetComponent <Collider>();

        //Register a Game Object in the sound engine, with its name.
        AKRESULT res = AkSoundEngine.RegisterGameObj(gameObject, gameObject.name);
        if (res == AKRESULT.AK_Success)
        {
            // Get position with offset or custom position and orientation.
            Vector3 position = GetPosition();
            Vector3 forward  = GetForward();
            Vector3 up       = GetUpward();

            //Set the original position
            AkSoundEngine.SetObjectPosition(
                gameObject,
                position.x, position.y, position.z,
                forward.x, forward.y, forward.z,
                up.x, up.y, up.z);

            if (isEnvironmentAware && m_Collider)
            {
                m_envData = new AkGameObjEnvironmentData();
                //Check if this object is also an environment.
                m_envData.AddAkEnvironment(m_Collider, m_Collider);
            }

            m_listeners.Initialize();
        }
    }
    private void OnEnableEditorListener(UnityEngine.GameObject gameObject)
    {
        if (!UnityEngine.Application.isPlaying && AkSoundEngine.IsInitialized() && editorListenerGameObject == null)
        {
            editorListenerGameObject = gameObject;

            AkSoundEngine.RegisterGameObj(editorListenerGameObject, editorListenerGameObject.name);

            // Do not create AkGameObj component when adding this listener
            var id = AkSoundEngine.GetAkGameObjectID(editorListenerGameObject);
            AkSoundEnginePINVOKE.CSharp_AddDefaultListener(id);

            UnityEditor.EditorApplication.update += UpdateEditorListenerPosition;
        }
    }
示例#16
0
    void Awake()
    {
        //Register a Game Object in the sound engine, with its name.
        AkSoundEngine.RegisterGameObj(gameObject, gameObject.name);

        //Set the original position
        AkSoundEngine.SetObjectPosition(
            gameObject,
            transform.position.x,
            transform.position.y,
            transform.position.z,
            transform.forward.x,
            transform.forward.y,
            transform.forward.z);
    }
示例#17
0
    private void Awake()
    {
        if (!this.isStaticObject)
        {
            this.m_posData = new AkGameObjPositionData();
        }
        AkSoundEngine.RegisterGameObj(base.gameObject, base.gameObject.name);
        Vector3 position = this.GetPosition();

        AkSoundEngine.SetObjectPosition(base.gameObject, position.x, position.y, position.z, base.transform.forward.x, base.transform.forward.y, base.transform.forward.z);
        if (this.isEnvironmentAware)
        {
            this.m_envData = new AkGameObjEnvironmentData();
            this.AddAuxSend(base.gameObject);
        }
    }
示例#18
0
    void Awake()
    {
#if UNITY_EDITOR
        if (AkUtilities.IsMigrating)
        {
            return;
        }

        if (!UnityEditor.EditorApplication.isPlaying)
        {
            UnityEditor.EditorApplication.update += this.CheckStaticStatus;
        }
#endif

        // If the object was marked as static, don't update its position to save cycles.
        if (!isStaticObject)
        {
            m_posData = new AkGameObjPositionData();
        }

        // Cache the bounds to avoid calls to GetComponent()
        m_Collider = GetComponent <Collider>();

        //Register a Game Object in the sound engine, with its name.
        AKRESULT res = AkSoundEngine.RegisterGameObj(gameObject, gameObject.name);
        if (res == AKRESULT.AK_Success)
        {
            // Get position with offset or custom position and orientation.
            //Set the original position
            AkSoundEngine.SetObjectPosition(gameObject, GetPosition(), GetForward(), GetUpward());

            if (isEnvironmentAware && m_Collider)
            {
                m_envData = new AkGameObjEnvironmentData();
                //Check if this object is also an environment.
                m_envData.AddAkEnvironment(m_Collider, m_Collider);

                m_envData.UpdateAuxSend(gameObject, transform.position);
            }

            int Count = m_listeners.initialListenerList.Count;
            for (int ii = 0; ii < Count; ++ii)
            {
                AddListener(m_listeners.initialListenerList[ii]);
            }
        }
    }
    private void OnEnableEditorListener(UnityEngine.GameObject gameObject)
    {
        if (!UnityEngine.Application.isPlaying && AkSoundEngine.IsInitialized() && editorListenerGameObject == null)
        {
            editorListenerGameObject = gameObject;

            // Clearing the isDirty flag of the AkAudioListener list.
            AkAudioListener.DefaultListeners.Refresh();

            AkSoundEngine.RegisterGameObj(editorListenerGameObject, editorListenerGameObject.name);

            var id = AkSoundEngine.GetAkGameObjectID(editorListenerGameObject);
            AkSoundEnginePINVOKE.CSharp_AddDefaultListener(id);

            UnityEditor.EditorApplication.update += UpdateEditorListenerPosition;
        }
    }
    private void OnEnableEditorListener(UnityEngine.GameObject gameObject)
    {
        if (IsPlayingOrIsNotInitialized || editorListenerGameObject != null)
        {
            return;
        }

        editorListenerGameObject = gameObject;
        AkSoundEngine.RegisterGameObj(editorListenerGameObject, editorListenerGameObject.name);

        // Do not create AkGameObj component when adding this listener
        var id = AkSoundEngine.GetAkGameObjectID(editorListenerGameObject);

        AkSoundEngine.AddDefaultListener(id);

        UnityEditor.EditorApplication.update += UpdateEditorListenerPosition;
    }
示例#21
0
    // Start is called before the first frame update
    void Start()
    {
        firstPersonControllerScript_ = player.GetComponent <FirstPersonController>();
        playerManagerScript_         = player.GetComponent <PlayerManager>();

        notAimingPosition = originalTransform;
        spreadAngle       = NotAimingSpreadAngle;

        objectPooler = ObjectPooler.instance;

        maxAmmo = playerManagerScript_.MaxAmmo;

        Ammo            = maxAmmo;
        bulletsOnWeapon = shotGunCapacity;

        //Make the gameobject self-aware.
        AkSoundEngine.RegisterGameObj(gameObject);
    }
示例#22
0
    void Awake()
    {
        // If the object was marked as static, don't update its position to save cycles.
#if UNITY_EDITOR
        if (!UnityEditor.EditorApplication.isPlaying)
        {
            //set enabled to true and is static to false to make sure that the update function is called in edit mode
            //the correct value for the isStaticObject variable will be set when update is called
            isStaticObject = false;
            enabled        = true;
            return;
        }
#endif
        if (!isStaticObject)
        {
            m_posData = new AkGameObjPositionData();
        }

        //Register a Game Object in the sound engine, with its name.
        AKRESULT res = AkSoundEngine.RegisterGameObj(gameObject, gameObject.name, (uint)(listenerMask & ALL_LISTENER_MASK));
        if (res == AKRESULT.AK_Success)
        {
            // Get position with offset
            Vector3 position = GetPosition();

            //Set the original position
            AkSoundEngine.SetObjectPosition(
                gameObject,
                position.x,
                position.y,
                position.z,
                transform.forward.x,
                transform.forward.y,
                transform.forward.z);

            if (isEnvironmentAware)
            {
                m_envData = new AkGameObjEnvironmentData();
                //Check if this object is also an environment.
                AddAuxSend(gameObject);
            }
        }
    }
示例#23
0
 public AkAutoObject(GameObject GameObj)
 {
     this.m_id = GameObj.GetInstanceID();
     AkSoundEngine.RegisterGameObj(GameObj, "AkAutoObject.cs");
 }
示例#24
0
 void Start()
 {
     AkSoundEngine.RegisterGameObj(gameObject);
 }
示例#25
0
 private void Awake()
 {
     AkSoundEngine.RegisterGameObj(gameObject);
     asource = GetComponent <AudioSource>();
     // body = GetComponent<Rigidbody2D>();
 }
示例#26
0
        public string MonsterWalk  =   "MonsterFootsteps";   //navn på lydfil i orange

                                                             // Start is called before the first frame update
        void Start()
        
    {
                AkSoundEngine.RegisterGameObj(gameObject);
            
    }
示例#27
0
 /// <summary>
 /// Post event by using this poolable object
 /// </summary>
 public void Post(AK.Wwise.Event audioEvent, GameObject target, string targetName)
 {
     AkSoundEngine.RegisterGameObj(gameObject, targetName);
     targetObj = target;
     audioEvent.Post(gameObject, (uint)AkCallbackType.AK_EndOfEvent, OnCallback);
 }
示例#28
0
 // Start is called before the first frame update
 void Start()
 {
     AkSoundEngine.RegisterGameObj(gameObject);
     ActionGameManager.PlayMusic(ActionGameManager.SoundBanksInfo.GetSoundBank(MusicSoundbankName).Id, gameObject);
 }
示例#29
0
 private void Awake()
 {
     trigger           = GetComponent <BoxCollider>();
     trigger.isTrigger = true;
     AkSoundEngine.RegisterGameObj(gameObject);
 }
示例#30
0
 public AkAutoObject(UnityEngine.GameObject GameObj)
 {
     m_id = (int)GameObj.GetInstanceID();
     AkSoundEngine.RegisterGameObj(GameObj, "AkAutoObject.cs", 0x01);
 }