示例#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);
        }