public void unregisterButton(DiceButton listener)
    {
        HashSet <DiceButton> tmplisteners = new HashSet <DiceButton>(buttons);

        tmplisteners.Remove(listener);
        buttons = tmplisteners;
    }
Exemple #2
0
        /// <summary>
        /// プレイヤーイベントの処理を行う関数(Update関数中の処理を移動したもの)
        /// </summary>
        private void ProcessPlayerEvent()
        {
            if (Data.PlayerEvents.Count != 0 && !SugorokuFrame.IsProcessingEvent)
            {
                if (Data.Player.PlayerID == Data.PlayerEvents.Peek().PlayerId)
                {
                    state = State.WaitThrowDice;
                }
                else
                {
                    SugorokuFrame.ProcessEvent(Data.PlayerEvents.Dequeue());
                }
            }

            // ダイスを振る処理
            if (state == State.WaitThrowDice && !SugorokuFrame.IsProcessingEvent && DiceTexture.AnimationFrame == 0)
            {
                SugorokuFrame.ProcessEvent(Data.PlayerEvents.Dequeue());
                state = State.WaitOtherPlayer;
            }
            else if (state == State.WaitThrowDice && DiceButton.LeftClicked() && !SugorokuFrame.IsProcessingEvent)
            {
                DiceTexture.AnimationStart(Data.PlayerEvents.Peek().Dice);
            }

            DiceTexture.Update();
        }
Exemple #3
0
 /// <summary>
 /// ゲームシーンの描画処理
 /// </summary>
 public void Draw()
 {
     SugorokuFrame.Draw();
     DiceButton.Draw();
     DiceButton.MouseOverDraw();
     DiceTexture.Draw();
     MyPlayer.Draw();
     MyPlayerText.DrawText();
     FontAsset.Draw(MessageTextFont, MessageText, 0, 800, DX.GetColor(50, 50, 50));
     if (state == State.DrawRanking)
     {
         SugorokuFrame.Draw();
         CloseButton.Draw();
         CloseButton.DrawText();
     }
 }
Exemple #4
0
    // Use this for initialization
    void Start()
    {
        if (buttonContainer != null)
        {
            for (int i = 0; i < diceObjectDatas.Length; i++)
            {
                if (diceButtonPrefab != null)
                {
                    buttons.Add(Instantiate(diceButtonPrefab, buttonContainer.transform, false));

                    DiceButton localDiceButton = buttons[i].GetComponent <DiceButton>();

                    localDiceButton.buttonIndex       = i;
                    localDiceButton.diceObjectData    = diceObjectDatas[i];
                    localDiceButton.diceTypeText.text = diceObjectDatas[i].label;
                }
            }
        }
    }
 public void registerButton(DiceButton listener)
 {
     HashSet<DiceButton> tmplisteners = new HashSet<DiceButton>(buttons);
     tmplisteners.Add(listener);
     buttons = tmplisteners;
 }