示例#1
0
 void Start()
 {
     Object[] objects = Object.FindObjectsOfType(typeof(GameObject));
     foreach (GameObject item in objects)
     {
         Jewellary jewellary = item.GetComponent <Jewellary>();
         if (jewellary != null)
         {
             jewellary.score = GetScore(jewellary.ItemColor);
         }
     }
 }
示例#2
0
    public void AddItem(Jewellary jewellary)
    {
        if (jewellarys.ContainsKey(jewellary.ItemColor))
        {
            Debug.LogWarning("Usage: jewellary " + jewellary.ItemColor + " exist");
        }
        else
        {
            jewellarys.Add(jewellary.ItemColor, jewellary.score);
            UpdateItemGUI(jewellary);

            Destroy(jewellary.gameObject);              // Destroy object
        }
    }
示例#3
0
    public void UpdateItems(Jewellary jewellary)
    {
        switch (jewellary.ItemColor)
        {
        case ItemColor.red:
            redJewellary.SetActive(true);
            break;

        case ItemColor.green:
            greenJewellary.SetActive(true);
            break;

        case ItemColor.blue:
            blueJewellary.SetActive(true);
            break;

        default:
            break;
        }
    }
示例#4
0
 private void UpdateItemGUI(Jewellary jewellary)
 {
     // Debug.Log("Get");
     itemGUI.UpdateItems(jewellary);
 }