ACR_CreatureBehavior.GameObjectManager.GetCreatureObject C# (CSharp) Method

GetCreatureObject() public method

Get the C# creature object for the given object id.
public GetCreatureObject ( uint ObjectId, bool CreateIfNeeded = false ) : CreatureObject
ObjectId uint Supplies the object id to look up.
CreateIfNeeded bool If true, the C# Creature object for /// the creature is created if the object didn't already exist.
return CreatureObject
        public CreatureObject GetCreatureObject(uint ObjectId, bool CreateIfNeeded = false)
        {
            CreatureObject Creature = (CreatureObject)GetGameObject(ObjectId, GameObjectType.Creature);

            if (Creature != null)
                return Creature;
            else if (CreateIfNeeded && Script.GetObjectType(ObjectId) == CLRScriptBase.OBJECT_TYPE_CREATURE)
                return new CreatureObject(ObjectId, this);
            else
                return null;
        }