示例#1
0
        void Start()
        {
            _killText.text    = "";
            _deadText.text    = "";
            _suicideText.text = "";
            _rankingText.text = "";

            _resultManager.OnScoreAsObservable
            .FirstOrDefault(x => x.PlayerId == _myId)
            .Subscribe(x =>
            {
                _resultScore = x;
            });

            //各要素の表示命令が来たら表示する
            _resultManager.OnShowKillScoreAsObservable
            .Subscribe(_ => _killText.text = string.Format("{0}", _resultScore.KillCount.ToString("+#;-#;0")));

            _resultManager.OnShowDeadScoreAsObservable
            .Subscribe(_ => _deadText.text = string.Format("{0}", _resultScore.DeadCount.ToString("-#;+#;0")));

            _resultManager.OnShowSuicideScoreAsObservable
            .Subscribe(_ => _suicideText.text = string.Format("{0}", _resultScore.SuicideCount.ToString("-#;+#;0")));

            //ランキングは自分のタイミングがきたら表示する
            _resultManager.OnShowRankingAsObservable
            .FirstOrDefault(x => x == _resultScore.Rank)
            .Subscribe(_ =>
            {
                _rankingText.text = string.Format("{0}<size=100>位</size>", _resultScore.Rank);
                _rankingTextShaker.ShakePosition(30, 10.0f);
                _rankingTextShaker.ShakeRotation(10, 10.0f);
            });
        }
示例#2
0
        public PrintViewModel(IEnumerable <ResultScore> scores, string group) : this()
        {
            Group = group;
            int         lastposition = 0;
            int         count        = 1;
            ResultScore lastItem     = null;
            int         color        = 0;


            foreach (var score in scores.OrderByDescending(s => s.FirstScore).ThenByDescending(s => s.SecondScore).ThenBy(s => s.Player))
            {
                string position;
                if (score.Compare(lastItem))
                {
                    count++;
                    position = string.Empty;
                }
                else
                {
                    lastposition += count;
                    position      = lastposition.ToString();
                    count         = 1;
                }
                Scores.Add(new PrintViewModelItem(position, score, color % 2 == 0 ? Colors.White : Colors.AliceBlue));

                lastItem = score;
                color++;
            }
        }
示例#3
0
        public bool Cam_MatchingModel()
        {
            bool Result;

            try
            {
                if (Cam_ModelType == "灰度匹配")
                {
                }
            }
            catch (Exception)
            {
                Xlabel.Text = "X:" + ResultPosX.ToString("F3");
                Ylabel.Text = "Y:" + ResultPosY.ToString("F3");
                Alabel.Text = "A:" + ResultAngle.ToString("F3");
                Slabel.Text = "S:" + ResultScore.ToString("F3");
                Result      = false;
            }

            //axCkvsModel1.RoiColor = Color.Blue;
            //axCkvsModel1.RoiLeft = Cam_RoiLeft;
            //axCkvsModel1.RoiTop = Cam_RoiTop;
            //axCkvsModel1.RoiRight = Cam_RoiRight;
            //axCkvsModel1.RoiBottom = Cam_RoiBottom;
            //axCkvsDisplay1.AddRoi(axCkvsModel1.GetRoi());
            //axCkvsModel1.ClearResults();
            //ResultPosX = 0; ResultAngle = 0; ResultPosY = 0; ResultScore = 0;
            //axCkvsModel1.Execute(axCkvsDisplay1.GetImage());
            //if (axCkvsModel1.GetMatchCount() > 0)
            //{
            //    ResultPosX = axCkvsModel1.GetMatchPositionX(0);
            //    ResultPosY = axCkvsModel1.GetMatchPositionY(0);
            //    ResultAngle = axCkvsModel1.GetMatchAngle(0);
            //    ResultScore = axCkvsModel1.GetMatchScore(0);

            //    Xlabel.Text = "X:" + ResultPosX.ToString("F3");
            //    Ylabel.Text = "Y:" + ResultPosY.ToString("F3");
            //    Alabel.Text = "A:" + ResultAngle.ToString("F3");
            //    Slabel.Text = "S:" + ResultScore.ToString("F3");
            //    Result = true;
            //}
            //else
            //{
            //    Xlabel.Text = "X:" + ResultPosX.ToString("F3");
            //    Ylabel.Text = "Y:" + ResultPosY.ToString("F3");
            //    Alabel.Text = "A:" + ResultAngle.ToString("F3");
            //    Slabel.Text = "S:" + ResultScore.ToString("F3");
            //    Result = false;
            //}

            return(false);
        }
示例#4
0
 private void OnValidate()
 {
     if (_scoreCounter == null)
     {
         _scoreCounter = FindObjectOfType <ScoreCounter>();
     }
     if (_player == null)
     {
         _player = FindObjectOfType <Player>();
     }
     if (_resultScore == null)
     {
         _resultScore = FindObjectOfType <ResultScore>();
     }
 }
示例#5
0
    // 스코어 표시 중.
    void UpdateScoreWait()
    {
        if (m_resultAnimationIndex >= m_playerIcons.Length)
        {
            return;
        }
        if (m_resultAnimationIndex == 0)
        {
            // 표시 시작.
            int pCount = m_playerScore.GetComponent <UserScore>().GetCount(SushiType.tamago);
            int oCount = m_opponentScore.GetComponent <UserScore>().GetCount(SushiType.tamago);
            m_playerIcons[0].GetComponent <ResultScore>().FadeIn(pCount, pCount * 8);
            m_opponentIcons[0].GetComponent <ResultScore>().FadeIn(oCount, oCount * 8);
            m_resultAnimationIndex = 1;

            return;
        }


        //스코어를 표시합니다.
        ResultScore prs = m_playerIcons[m_resultAnimationIndex - 1].GetComponent <ResultScore>();
        ResultScore ors = m_opponentIcons[m_resultAnimationIndex - 1].GetComponent <ResultScore>();

        //애니메이션이 끝나면 다음 애니메이션을 재생합니다.
        if (prs.IsEnd() && ors.IsEnd())
        {
            if (m_resultAnimationIndex >= m_playerIcons.Length)
            {
                return;
            }

            SushiType[] typeList  = { SushiType.tamago, SushiType.ebi, SushiType.ikura, SushiType.toro };
            int[]       pointList = { 8, 10, 12, 15 }; // 초밥 타입별 득점 정의.

            SushiType type   = typeList[m_resultAnimationIndex];
            int       point  = pointList[m_resultAnimationIndex];
            int       pCount = m_playerScore.GetComponent <UserScore>().GetCount(type);
            int       oCount = m_opponentScore.GetComponent <UserScore>().GetCount(type);

            //득점 표시 시작.
            m_playerIcons[m_resultAnimationIndex].GetComponent <ResultScore>().FadeIn(pCount, pCount * point);
            m_opponentIcons[m_resultAnimationIndex].GetComponent <ResultScore>().FadeIn(oCount, oCount * point);

            m_resultAnimationIndex++;
        }
    }
示例#6
0
        private void BindingInitialize()
        {
            Binding DifficultyBinding = new Binding("Difficulty")
            {
                Source = Host
            };

            DifficultyLabel.SetBinding(Label.ContentProperty, DifficultyBinding);

            Binding LevelBinding = new Binding("Level")
            {
                Source = Host
            };

            LevelLabel.SetBinding(Label.ContentProperty, LevelBinding);

            Binding ScoreBinding = new Binding("Score")
            {
                Source = Host
            };

            ScoreLabel.SetBinding(Label.ContentProperty, ScoreBinding);
            ResultScore.SetBinding(Label.ContentProperty, ScoreBinding);

            Binding LevelupProgressBinding = new Binding("LevelupProgress")
            {
                Source = Host
            };
            Binding LevelupMaximumBinding = new Binding("LevelupMaximum")
            {
                Source = Host
            };

            LevelupProgressBar.SetBinding(ProgressBar.ValueProperty, LevelupProgressBinding);
            LevelupProgressBar.SetBinding(ProgressBar.MaximumProperty, LevelupMaximumBinding);

            Binding TotalClearRowsBinding = new Binding("TotalClearRows")
            {
                Source = Host
            };

            ResultClearRows.SetBinding(Label.ContentProperty, TotalClearRowsBinding);
        }
示例#7
0
    // Update is called once per frame
    void FixedUpdate()
    {
        switch (m_state)
        {
        case State.In:
            //배경 페이드 인.
            if (m_resultback.GetComponent <Animation>().isPlaying == false)
            {
                //서버 클라이언트 아이콘 표시를 ON으로 합니다.
                GameObject.Find("server_icon").GetComponent <SpriteRenderer>().enabled = true;
                GameObject.Find("client_icon").GetComponent <SpriteRenderer>().enabled = true;

                //효과음-카운트업음 재생.
                GetComponent <AudioSource>().Play();

                m_state = State.ScoreWait;
            }
            break;

        case State.ScoreWait:
            UpdateScoreWait();  //스코어 표시.

            ResultScore prs = m_playerIcons[3].GetComponent <ResultScore>();
            ResultScore ors = m_opponentIcons[3].GetComponent <ResultScore>();
            if (prs.IsEnd() && ors.IsEnd())
            {
                //표시를 마치고 합계 득점을 표시합니다.
                m_resultPlayer.GetComponent <Number>().SetNum(GetResultScore(m_playerScore));
                m_resultOpponent.GetComponent <Number>().SetNum(GetResultScore(m_opponentScore));
                m_resultPlayer.GetComponent <Animation>().Play("ResultScore");
                m_resultOpponent.GetComponent <Animation>().Play("ResultScore");
                //SE.
                m_resultPlayer.GetComponent <AudioSource>().PlayDelayed(0.75f);
                GetComponent <AudioSource>().Stop(); //카운트업 효과음 정지.

                m_state = State.TotalScore;
            }
            break;

        case State.TotalScore:
            //합계 득점 표시 대기.
            Animation pAnim = m_resultPlayer.GetComponent <Animation>();
            Animation oAnim = m_resultOpponent.GetComponent <Animation>();
            if (pAnim.isPlaying == false && oAnim.isPlaying == false)
            {
                m_state = State.WinLose;
            }
            break;

        case State.WinLose:
            if (m_winlose == null)
            {
                //win/lose 표시 시작.
                if (GetResultScore(m_playerScore) < GetResultScore(m_opponentScore))
                {
                    m_winlose = Instantiate(m_losePrefab) as GameObject;  //패배.
                }
                else
                {
                    m_winlose = Instantiate(m_winPrefab) as GameObject;   //승리.
                }
                m_winlose.name = "winlose";
                return;
            }

            if (m_winlose.GetComponent <Animation>().isPlaying == false)
            {
                Destroy(m_winlose);
                m_state = State.End;
            }
            break;

        case State.End:
            break;
        }
    }
示例#8
0
 private void Awake()
 {
     Instance = this;
 }
示例#9
0
 public PrintViewModelItem(string position, ResultScore score, Color background)
 {
     Place      = position;
     this.score = score;
     Background = background;
 }
示例#10
0
        public List <string> Cam_GetImageInfo()
        {
            string        CurCamPix   = "";
            List <string> ArrayCamPix = new List <string>();

            CurCamPix = ResultPosX.ToString("F3") + "," + ResultPosY.ToString("F3") + "," + ResultAngle.ToString("F3") + "," + ResultScore.ToString("F3");
            ArrayCamPix.Add(CurCamPix + ".");
            return(ArrayCamPix);
        }