Example #1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Example #2
0
    void OnClick(MasterData.GachaTopData data)
    {
        Reset();

        gameObject.SetActive(false);
        GachaManager.OpenGachaItemList(data);
    }
Example #3
0
    void Start()
    {
        GachaManager        manager      = new GachaManager(rateButton);
        TiketManager        ticket       = new TiketManager();
        ConfirmationManager confirmation = new ConfirmationManager();

        IniRequest();
    }
    // Start is called before the first frame update
    void Start()
    {
        gameObject.SetActive(false);

        closeButton.onClick.AddListener(() =>
        {
            GachaManager.OpenGachaTop();
            gameObject.SetActive(false);
        });
    }
Example #5
0
        public async Task Roll(CommandContext context)
        {
            var msgChannel = context.Channel;
            var rollResult = GachaManager.Roll();

            var   sendPictureTask = msgChannel.SendFileAsync(Paths.SimpleRollBlue);
            await sendPictureTask;

            Thread.Sleep(1000);

            var sendMessageTask = msgChannel.SendMessageAsync($"{context.Message.Author.Mention} заролил {rollResult.Name}");
            await sendMessageTask.ConfigureAwait(false);
        }
Example #6
0
    public void Open(MasterData.GachaItemData[] datas)
    {
        gameObject.SetActive(true);

        RectTransform baseRectTrans = gachaItemBase.transform as RectTransform;
        float         sizeY         = baseRectTrans.sizeDelta.y;

        // 降順
        Array.Sort(datas, (a, b) => b.Groupid - a.Groupid);

        int maxCount = datas.Length;

        for (int i = 0; i < maxCount; i++)
        {
            var itemData = datas[i];
            var instance = Instantiate(gachaItemBase);
            instance.SetActive(true);

            instance.transform.SetParent(contentsTrans);
            instance.transform.localPosition = gachaItemBase.transform.localPosition + (Vector3.down * sizeY * i);

            UIGachaItemData uiData = new UIGachaItemData();
            uiData.trans     = instance.transform as RectTransform;
            uiData.nameText  = uiData.trans.Find("Text_Name").GetComponent <Text>();
            uiData.rareText  = uiData.trans.Find("Text_Rare").GetComponent <Text>();
            uiData.rateText  = uiData.trans.Find("Text_Rate").GetComponent <Text>();
            uiData.iconImage = uiData.trans.Find("Image_Icon").GetComponent <Image>();

            var characterData  = GachaManager.GetCharacterData(itemData.Characterid);
            var rareWeightData = GachaManager.GetGachaRareWeightData(itemData.Topid, itemData.Groupid);
            uiData.nameText.text    = characterData.Name;
            uiData.rareText.text    = "★" + characterData.Rare;
            uiData.rateText.text    = "排出率:" + rareWeightData.Weight + "%";
            uiData.iconImage.sprite = IconManager.GetIconSprite(characterData.Iconid);

            uiGachaItemData.Add(uiData);
        }

        var size = contentsTrans.sizeDelta;

        size.y = maxCount * sizeY;
        contentsTrans.sizeDelta = size;

        gachaItemData = datas;
    }
Example #7
0
    // Start is called before the first frame update
    void Start()
    {
        gameObject.SetActive(false);
        gachaItemBase.SetActive(false);

        backButton.onClick.AddListener(() =>
        {
            Reset();
            gameObject.SetActive(false);
            GachaManager.OpenGachaTop();
        });

        okButton.onClick.AddListener(() =>
        {
            GachaManager.OpenGachaResult(ref gachaItemData);
            Reset();
            gameObject.SetActive(false);
        });
    }
Example #8
0
        public async Task Roll10(CommandContext context)
        {
            var msgChannel = context.Channel;

            for (var i = 0; i < 10; i++)
            {
                if (i != 0)
                {
                    _sb.Append(" / ");
                }

                var gachaResult = GachaManager.Roll();
                _sb.Append($"{gachaResult.Name}");
            }

            var message         = _sb.ToString();
            var sendMessageTask = msgChannel.SendMessageAsync($"{context.Message.Author.Mention} заролил {message}");

            _sb.Clear();

            await sendMessageTask.ConfigureAwait(false);
        }
Example #9
0
 private void Awake()
 {
     instance   = this;
     isInstance = instance != null;
 }