示例#1
0
        // 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
 static public InventoryController getInventoryType(InventoryController.Inventory type = InventoryController.Inventory.Both)
 {
     return(new List <InventoryController>(Data.instance.GetComponentsInChildren <InventoryController>()).Find(x => x.inventoryType == type));
 }