示例#1
0
文件: Cheat.cs 项目: Kyvi/8INF830
        // Use this for initialization
        void Start()
        {
            model = FindObjectOfType <InventoryModel>();
            List <InventoryController> controllers = new List <InventoryController>(FindObjectsOfType <InventoryController>());

            InventoryController.Inventory type = InventoryController.Inventory.Both;
            switch (inventoryType)
            {
            case Inventory.Ship:
                type = InventoryController.Inventory.Ship;
                break;

            case Inventory.Base:
                type = InventoryController.Inventory.Base;
                break;

            default:
                break;
            }
            controller = controllers.Find(x => x.inventoryType == type);
        }
示例#2
0
        public Slot(InventoryModel model, Item item = null, int amount = 0)

        {

            if (idManager == null)

                idManager = new IDManager();

            this.id = idManager.GetNewID();

            this.model = model;

            this.item = item;

            this.amount = amount;

            if (mappedSlots == null)

                mappedSlots = new Dictionary<int, Slot>();

            mappedSlots.Add(id, this);

        }
示例#3
0
 // Use this for initialization
 void Start()
 {
     model      = FindObjectOfType <InventoryModel>();
     controller = FindObjectsOfType <InventoryController>();
 }
示例#4
0
 private void SetInventoryModel(InventoryModel.Inventory invType, List <InventoryModel> allModels)
 {
     model = allModels.Find(model => model.inventoryType == invType);
 }