Exemplo n.º 1
0
    void OngiftBtn()
    {
        MusicManager.PlaySe("click");
        IEnumerable <Toggle> gifts = giftGrid.GetComponent <ToggleGroup>().ActiveToggles();

        foreach (var gift in gifts)
        {
            if (gift.isOn)
            {
                string giftId = gift.transform.Find("Image").GetComponent <Image>().sprite.name;
                int    count  = int.Parse(gift.transform.Find("Text").GetComponent <Text>().text);
                if (count >= 1)
                {
                    count--;
                    gift.transform.Find("Text").GetComponent <Text>().text = count.ToString();
                    for (int i = 0; i < Globals.items.Count; i++)
                    {
                        if (Globals.items[i].itemId == giftId)
                        {
                            Globals.items[i].count = count;
                            RoomGlobals.loveDic[RoomGlobals.currentId].love += Globals.items[i].value;
                            if (RoomGlobals.loveDic[RoomGlobals.currentId].love >= RoomGlobals.loveDic[RoomGlobals.currentId].maxLove)
                            {
                                RoomGlobals.loveDic[RoomGlobals.currentId].lv++;
                                RoomGlobals.loveDic[RoomGlobals.currentId].love -= RoomGlobals.loveDic[RoomGlobals.currentId].maxLove;
                            }
                            break;
                        }
                    }
                    RoomFuncs.ChangeLove();
                }
            }
        }
    }
Exemplo n.º 2
0
 void Oncharacter_roomSelectBtnClick(Transform point, string modelPath)
 {
     MusicManager.PlaySe("click");
     RoomFuncs.CreateCharacter(point, modelPath);
     Destroy(gameObject);
     RoomGlobals.currentId = modelPath.Replace("Prefabs/", "");
     RoomFuncs.ChangeLove();
 }
Exemplo n.º 3
0
 void OnExchangeCharacter(Transform point1, string modelPath1,
                          Transform point2, string modelPath2)
 {
     MusicManager.PlaySe("click");
     RoomFuncs.DestroyAll();
     RoomFuncs.CreateCharacter(point1, modelPath2);
     RoomFuncs.CreateCharacter(point2, modelPath1);
     RoomGlobals.currentId = modelPath2.Replace("Prefabs/", "");
     RoomFuncs.ChangeLove();
 }
Exemplo n.º 4
0
    IEnumerator IShowActs()
    {
        yield return(new WaitForSeconds(1f));

        //Acts
        acts = GameFuncs.FindHiden("ActsParent");
        acts.SetActive(true);
        GameObject menu = acts.transform.Find("menu").gameObject;

        RoomGlobals.menu = menu;
        RoomGlobals.menu.SetActive(true);
        BindActsBtns();
        RoomFuncs.ChangeLove();
    }