当前位置: 首页>>代码示例>>C#>>正文


C# Song.setDifficulty方法代码示例

本文整理汇总了C#中Song.setDifficulty方法的典型用法代码示例。如果您正苦于以下问题:C# Song.setDifficulty方法的具体用法?C# Song.setDifficulty怎么用?C# Song.setDifficulty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Song的用法示例。


在下文中一共展示了Song.setDifficulty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: readChart


//.........这里部分代码省略.........
                //easy variable getted
                theNewsong.title = title;
                theNewsong.subtitle = subtitle;
                theNewsong.artist = artist;
                theNewsong.banner = banner;
                theNewsong.offset = offset;
                theNewsong.samplestart = samplestart;
                theNewsong.samplelenght = samplelenght;
                theNewsong.bpms = theBpmList;
                theNewsong.stops = theStopList;
                theNewsong.mesureBPMS = theBpmMesureList;
                theNewsong.mesureSTOPS = theStopMesureList;
                theNewsong.bpmToDisplay = thedisplayBPM;
                /*if(files.FirstOrDefault(c => c.Contains(".ogg")) == null){
                    foreach(var fil in files){
                        Debug.Log(fil);
                    }
                }*/
                theNewsong.song = "file://" + files.FirstOrDefault(c => c.Contains(".ogg") || c.Contains(".OGG")).Replace('\\', '/');

                //getting song information
                int beginInformation = index;
                string dl = "";
                var theinfo = listLine.ElementAt(beginInformation + 1).Replace(":","").Trim();
                if(theinfo.Contains("double")){
                    dl = "D";
                }else
                if(!theinfo.Contains("single") || theinfo.Contains("pump") || theinfo.Contains("ez2") ||
                        theinfo.Contains("para") || theinfo.Contains("ds3ddx") || theinfo.Contains("pnm") ||
                        theinfo.Contains("bm") || theinfo.Contains("maniax") || theinfo.Contains("techno")){
                    dl = "STOP";
                }
                theNewsong.stepartist = listLine.ElementAt(beginInformation + 2).Replace(":","").Trim();
                theNewsong.setDifficulty(dl + listLine.ElementAt(beginInformation + 3).Replace(":","").Trim());
                theNewsong.level = System.Convert.ToInt32(listLine.ElementAt(beginInformation + 4).Replace(":","").Trim());

                //getting stepchart
                int beginstepchart = beginInformation+6;
                while(listLine.ElementAt(beginstepchart).Contains("//") ||
                    String.IsNullOrEmpty(listLine.ElementAt(beginstepchart).Trim()) ||
                    listLine.ElementAt(beginstepchart) == ""){

                        if(listLine.ElementAt(beginstepchart).Contains("NOTES")) dl = "STOP";
                        beginstepchart++;
                }

                if(listLine.ElementAt(beginstepchart).Contains("NOTES")) dl = "STOP";
                //if(theNewsong.title == "The Last Kiss") Debug.Log(listLine.ElementAt(beginstepchart));

                if(dl != "STOP"){
                    var numberOfSteps = 0;
                    var numberOfMines = 0;
                    var numberOfRoll = 0;
                    var numberOfFreezes = 0;
                    var numberOfJump = 0;
                    var numberOfStepsWJ = 0;
                    theNewsong.stepchart.Add(new List<string>());
                    for(int i = beginstepchart; !listLine.ElementAt(i).Contains(";"); i++){
                        if(listLine.ElementAt(i).Contains(",")){
                            theNewsong.stepchart.Add(new List<string>());
                        }else if(!String.IsNullOrEmpty(listLine.ElementAt(i))){
                            theNewsong.stepchart.Last().Add(listLine.ElementAt(i));
                            numberOfSteps += listLine.ElementAt(i).Count(c => c == '1');
                            numberOfSteps += listLine.ElementAt(i).Count(c => c == '2');
                            numberOfSteps += listLine.ElementAt(i).Count(c => c == '4');
                            numberOfFreezes += listLine.ElementAt(i).Count(c => c == '2');
开发者ID:bobwister,项目名称:Unity-ITGHD,代码行数:67,代码来源:OpenChart.cs


注:本文中的Song.setDifficulty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。