コード例 #1
0
    // Use this for initialization
    void Start()
    {
        songName   = GameObject.Find("TextSongName").GetComponent <Text>();
        songWriter = GameObject.Find("TextSongWriter").GetComponent <Text>();
        difficulty = GameObject.Find("ButtonDifficulty").GetComponent <Button>();

        flawlessCount = GameObject.Find("TextFlawlessCount").GetComponent <Text>();
        greatCount    = GameObject.Find("TextGreatCount").GetComponent <Text>();
        goodCount     = GameObject.Find("TextGoodCount").GetComponent <Text>();
        missCount     = GameObject.Find("TextMissCount").GetComponent <Text>();
        combo         = GameObject.Find("TextCombo").GetComponent <Text>();
        achievement   = GameObject.Find("TextAchievement").GetComponent <Text>();
        highScore     = GameObject.Find("TextHighScore").GetComponent <Text>();

        record = PerformanceRecorder.instance.newRecord;

        songName.text      = record.song.songName;
        songWriter.text    = record.song.songWriter;
        flawlessCount.text = record.flawlessCount.ToString();
        greatCount.text    = record.greatCount.ToString();
        goodCount.text     = record.goodCount.ToString();
        missCount.text     = record.missCount.ToString();
        combo.text         = (record.flawlessCount + record.greatCount + record.goodCount).ToString();
        achievement.text   = "100%test";
        highScore.text     = "10000text";
    }
コード例 #2
0
        public override void Add(IPlayerItem playerItem)
        {
            var record = new PlayRecord();

            record.PlayItemId     = playerItem.PlayItem.Id;
            record.PlaybillItemId = playerItem.PlayItem.PlaybillItem.Id;
            record.ScheduleMode   = playerItem.PlayItem.PlaybillItem.ScheduleMode;

            record.SourceId    = playerItem.PlayItem.PlaybillItem.MediaSource.Id;
            record.SourceTitle = playerItem.PlayItem.PlaybillItem.MediaSource.Title;
            var sourceDuration = playerItem.PlayItem.PlaybillItem.MediaSource.Duration;

            if (sourceDuration != null)
            {
                record.SourceDuration = sourceDuration.Value.TotalSeconds;
            }

            record.SourceCategory = playerItem.PlayItem.PlaybillItem.MediaSource.Category;


            record.ActualStartTime = playerItem.StartTime;
            //var loadTime = this.LoadTime;
            record.ActualStopTime = playerItem.StopTime;

            record.PlayItemStartTime  = playerItem.PlayItem.StartTime;
            record.LoadMarkerIn       = playerItem.LoadRange.StartPosition.TotalSeconds;
            record.LoadMarkerDuration = playerItem.LoadRange.Duration.TotalSeconds;

            record.PlayItemMarkerIn = playerItem.PlayItem.PlayRange.StartPosition.TotalSeconds;
            record.PlayItemDuration = playerItem.PlayItem.CalculatedPlayDuration.TotalSeconds;

            PlayoutRepository.AddPlayRecord(record);
        }
コード例 #3
0
ファイル: PlayRecord.cs プロジェクト: hale445566/CodeLibrary
    public static PlayRecord Instance()
    {
        if (instance == null)
        {
            instance = new GameObject("PlayRecord").AddComponent <PlayRecord>();
        }

        return(instance);
    }
コード例 #4
0
    //public Song song;
    //public Difficulty difficulty;
    // Use this for initialization
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        if (SongPlateManager.instance != null)
        {
            newRecord = new PlayRecord(SongPlateManager.selectedSong, SongPlateManager.selectedDifficulty);
        }
        else
        {
            newRecord = new PlayRecord(new Song(), Difficulty.HARD);
        }


        albumJacket = GameObject.Find("ImageAlbumJacket");
        songName    = GameObject.Find("SongName");
        difficulty  = GameObject.Find("Difficulty");
        buttonSN    = GameObject.Find("ButtonSN");
        buttonD     = GameObject.Find("ButtonD");

        albumJacket.GetComponent <RawImage>().texture = Resources.Load <Texture2D>(SongPlateManager.selectedSong.audioDataPath);
        songName.GetComponent <Text>().text           = SongPlateManager.selectedSong.songName;
        buttonSN.GetComponent <Button>().interactable = false;
        ColorBlock sn = buttonSN.GetComponent <Button>().colors;

        sn.disabledColor = new Color(1, 1, 1);
        buttonSN.GetComponent <Button>().colors      = sn;
        difficulty.GetComponent <Text>().text        = SongPlateManager.selectedDifficulty.ToString();
        buttonD.GetComponent <Button>().interactable = false;
        ColorBlock d = buttonD.GetComponent <Button>().colors;

        switch (SongPlateManager.selectedDifficulty)
        {
        case Difficulty.EASY:
            d.disabledColor = new Color(0.7411249f, 1, 0.4669811f);
            break;

        case Difficulty.NORMAL:
            d.disabledColor = new Color(1, 0.9869514f, 0.5518868f);
            break;

        case Difficulty.HARD:
            d.disabledColor = new Color(1, 0.4858491f, 0.4858491f);
            break;
        }
        buttonD.GetComponent <Button>().colors = d;
    }