ACR_CreatureBehavior.GameObjectManager.GetGameObject C# (CSharp) Method

GetGameObject() public method

Look up the internal GameObject for an object by object id and return the C# object state for it. The routine does not create the object state for an object id that is valid but unrecognized to us (i.e. that we have not yet seen even though it exists engine-side).
public GetGameObject ( uint ObjectId ) : ACR_CreatureBehavior.GameObject
ObjectId uint Supplies the object id to look up.
return ACR_CreatureBehavior.GameObject
        public GameObject GetGameObject(uint ObjectId)
        {
            GameObject GameObj;

            if (ObjectId == CLRScriptBase.OBJECT_INVALID)
                return null;

            if (!GameObjectTable.TryGetValue(ObjectId, out GameObj))
                return null;

            //
            // Even though we have a record of the object in our lookup table,
            // the engine may have already removed its representation of the
            // object.  In that case, pretend that the object state doesn't
            // exist for purposes of by-object-id lookups.
            //

            if (!GameObj.Exists)
                return null;

            return GameObj;
        }

Same methods

GameObjectManager::GetGameObject ( uint ObjectId, GameObjectType ObjectType ) : ACR_CreatureBehavior.GameObject