ObjectInteraction.ChangeType C# (CSharp) Method

ChangeType() public method

public ChangeType ( int newID, int newType ) : bool
newID int
newType int
return bool
    public virtual bool ChangeType(int newID, int newType)
    {
        //Changes the type of the object. Eg when destroyed and it needs to become debris.
                item_id=newID;
                //ItemType=newType;
                WorldDisplayIndex=newID;
                InvDisplayIndex=newID;
                //Destroy(this.gameObject.GetComponent<object_base>());
                UpdateAnimation();
                return true;
    }

Usage Example

Ejemplo n.º 1
0
    void SpoilPotion(ObjectInteraction obj)
    {
        obj.ChangeType(228);
        obj.isquant = 0;

        ObjectLoaderInfo newobjt = ObjectLoader.newWorldObject(384, 40, 1, 0, 256);

        newobjt.InUseFlag = 1;
        ObjectInteraction created = ObjectInteraction.CreateNewObject(CurrentTileMap(), newobjt, CurrentObjectList().objInfo, GameWorldController.instance.DynamicObjectMarker().gameObject, GameWorldController.instance.InventoryMarker.transform.position);

        GameWorldController.MoveToInventory(created);
        created.transform.parent           = GameWorldController.instance.InventoryMarker.transform;
        obj.GetComponent <Potion>().linked = created;
        obj.GetComponent <Potion>().SetDisplayEnchantment();
    }
All Usage Examples Of ObjectInteraction::ChangeType