示例#1
0
        private void Awake()
        {
            Bag bag = (Bag)Instantiate(items[0]);

            bag.Initialize(16);
            bag.Use();
        }
示例#2
0
 private void LateUpdate()
 {
     if (Input.GetKeyDown(KeyCode.I))
     {
         Bag bag = (Bag)Instantiate(items[0]);
         bag.Initialize(16);
         bag.Use();
     }
     if (Input.GetKeyDown(KeyCode.J))
     {
         Bag bag = (Bag)Instantiate(items[0]);
         bag.Initialize(8);
         AddItem(bag);
     }
     if (Input.GetKeyDown(KeyCode.K))
     {
         Bag bag = (Bag)Instantiate(items[0]);
         bag.Initialize(16);
         AddItem(bag);
     }
     if (Input.GetKeyDown(KeyCode.L))
     {
         HealthPotion potion = (HealthPotion)Instantiate(items[1]);
         AddItem(potion);
     }
     if (Input.GetKeyDown(KeyCode.V))
     {
         Apple apple = (Apple)Instantiate(items[2]);
         AddItem(apple);
     }
 }