コード例 #1
0
 public void InstantiateSingleVertical(LanotaCameraY Ver)
 {
     if (Ver.TimeLineGameObject != null)
     {
         Destroy(Ver.TimeLineGameObject);
     }
     Ver.TimeLineGameObject = Instantiate(TimeLineObject, VerTransform);
     Ver.TimeLineGameObject.GetComponent <RectTransform>().anchoredPosition = new Vector2(Ver.Time * Scale, 0);
     Ver.TimeLineGameObject.GetComponent <RectTransform>().sizeDelta        = new Vector2(Ver.Duration * Scale, 30);
     Ver.TimeLineGameObject.GetComponent <Image>().color = Tp10;
     Ver.TimeLineGameObject.GetComponent <Button>().onClick.AddListener(OperationManager.OnTimeLineClick);
     Ver.InstanceId = Ver.TimeLineGameObject.GetInstanceID();
 }
コード例 #2
0
        public void CreateVerticalMotion(float timing, float length, float ctp0 = 0.0f, int ease = 0)
        {
            var camera = new LanotaCameraY()
            {
                Time     = timing,
                Duration = length,
                Type     = 10,
                ctp      = ctp0,
                cfmi     = ease
            };

            _Operation.AddVertical(camera, length <= 0.0f);
        }
コード例 #3
0
            public LanotaCameraY DeepCopy()
            {
                LanotaCameraY New = new LanotaCameraY
                {
                    Type     = Type,
                    Time     = Time,
                    Duration = Duration,
                    ctp      = ctp,
                    ctp1     = ctp1,
                    ctp2     = ctp2,
                    cfmi     = cfmi,
                    cflg     = cflg
                };

                return(New);
            }
コード例 #4
0
 public ChartData(string Text)
 {
     Json.LnmReadJson MidJson;
     MidJson = JsonConvert.DeserializeObject <Json.LnmReadJson>(Text);
     if (MidJson == null)
     {
         MidJson = JsonConvert.DeserializeObject <Json.LnmReadJson>("{\"events\":null,\"eos\":0,\"bpm\":null,\"scroll\":null}");
     }
     LanotaCameraRot = new List <LanotaCameraRot>();
     LanotaCameraXZ  = new List <LanotaCameraXZ>();
     LanotaCameraY   = new List <LanotaCameraY>();
     LanotaChangeBpm = new List <LanotaChangeBpm>();
     LanotaDefault   = new LanotaDefault();
     LanotaHoldNote  = new List <LanotaHoldNote>();
     LanotaScroll    = new List <LanotaScroll>();
     LanotaTapNote   = new List <LanotaTapNote>();
     //Events
     if (MidJson.events != null)
     {
         for (int i = 0; i < MidJson.events.Count; ++i)
         {
             int Type = MidJson.events[i].Type;
             if (Type == 0 || Type == 2 || Type == 3 || Type == 4)
             {
                 LanotaTapNote TmpTap = new LanotaTapNote();
                 TmpTap.Type        = Type;
                 TmpTap.Time        = MidJson.events[i].Timing;
                 TmpTap.Duration    = MidJson.events[i].Duration;
                 TmpTap.Degree      = MidJson.events[i].Degree;
                 TmpTap.Size        = MidJson.events[i].Size;
                 TmpTap.Critical    = MidJson.events[i].Critical;
                 TmpTap.Combination = MidJson.events[i].Combination;
                 TmpTap.Bpm         = MidJson.events[i].Bpm;
                 TmpTap.Sizef       = MidJson.events[i].Sizef;
                 LanotaTapNote.Add(TmpTap);
             }
             else if (Type == 5)
             {
                 LanotaHoldNote TmpHold = new LanotaHoldNote();
                 TmpHold.Type        = Type;
                 TmpHold.Time        = MidJson.events[i].Timing;
                 TmpHold.Duration    = MidJson.events[i].Duration;
                 TmpHold.Jcount      = MidJson.events[i].joints.j_count;
                 TmpHold.Degree      = MidJson.events[i].Degree;
                 TmpHold.Combination = MidJson.events[i].Combination;
                 TmpHold.Sizef       = MidJson.events[i].Sizef;
                 if (TmpHold.Jcount != 0)
                 {
                     TmpHold.Joints = new List <LanotaJoints>();
                     for (int j = 0; j < MidJson.events[i].joints.j.Count; ++j)
                     {
                         LanotaJoints JTmpHold = new LanotaJoints();
                         JTmpHold.dDegree = MidJson.events[i].joints.j[j].d_deg;
                         JTmpHold.dTime   = MidJson.events[i].joints.j[j].d_time;
                         float TmpDegree = TmpHold.Degree + JTmpHold.dDegree;
                         float TmpTime   = TmpHold.Time + JTmpHold.dTime;
                         for (int k = 0; k < j; ++k)
                         {
                             TmpDegree += TmpHold.Joints[k].dDegree;
                             TmpTime   += TmpHold.Joints[k].dTime;
                         }
                         JTmpHold.aDegree = TmpDegree;
                         JTmpHold.aTime   = TmpTime;
                         JTmpHold.Cfmi    = MidJson.events[i].joints.j[j].d_e;
                         TmpHold.Joints.Add(JTmpHold);
                     }
                 }
                 TmpHold.Size     = MidJson.events[i].Size;
                 TmpHold.Critical = MidJson.events[i].Critical;
                 TmpHold.Bpm      = MidJson.events[i].Bpm;
                 LanotaHoldNote.Add(TmpHold);
             }
             else if (Type == 8 || Type == 11)
             {
                 LanotaCameraXZ TmpCam = new LanotaCameraXZ();
                 TmpCam.Type     = Type;
                 TmpCam.Time     = MidJson.events[i].Timing;
                 TmpCam.Duration = MidJson.events[i].Duration;
                 TmpCam.ctp      = MidJson.events[i].ctp;
                 TmpCam.ctp1     = MidJson.events[i].ctp1;
                 TmpCam.ctp2     = MidJson.events[i].ctp2;
                 TmpCam.cfmi     = MidJson.events[i].cfmi;
                 TmpCam.cflg     = MidJson.events[i].cflg;
                 LanotaCameraXZ.Add(TmpCam);
             }
             else if (Type == 10)
             {
                 LanotaCameraY TmpCam = new LanotaCameraY();
                 TmpCam.Type     = Type;
                 TmpCam.Time     = MidJson.events[i].Timing;
                 TmpCam.Duration = MidJson.events[i].Duration;
                 TmpCam.ctp      = MidJson.events[i].ctp;
                 TmpCam.ctp1     = MidJson.events[i].ctp1;
                 TmpCam.ctp2     = MidJson.events[i].ctp2;
                 TmpCam.cfmi     = MidJson.events[i].cfmi;
                 TmpCam.cflg     = MidJson.events[i].cflg;
                 LanotaCameraY.Add(TmpCam);
             }
             else if (Type == 12)
             {
                 LanotaDefault.CamRou    = MidJson.events[i].ctp;
                 LanotaDefault.CamTheta  = MidJson.events[i].ctp1;
                 LanotaDefault.CamHeight = MidJson.events[i].ctp2;
                 LanotaDefault.Degree    = MidJson.events[i].Degree;
             }
             else if (Type == 13)
             {
                 LanotaCameraRot TmpCam = new LanotaCameraRot();
                 TmpCam.Type     = Type;
                 TmpCam.Time     = MidJson.events[i].Timing;
                 TmpCam.Duration = MidJson.events[i].Duration;
                 TmpCam.ctp      = MidJson.events[i].ctp * -1;
                 TmpCam.ctp1     = MidJson.events[i].ctp1;
                 TmpCam.ctp2     = MidJson.events[i].ctp2;
                 TmpCam.cfmi     = MidJson.events[i].cfmi;
                 TmpCam.cflg     = MidJson.events[i].cflg;
                 LanotaCameraRot.Add(TmpCam);
             }
         }
     }
     //Bpm
     if (MidJson.bpm != null)
     {
         if (MidJson.bpm.Count != 0)
         {
             LanotaChangeBpm FirstTmpBpm = new LanotaChangeBpm();
             FirstTmpBpm.Type        = MidJson.bpm[0].Type;
             FirstTmpBpm.Time        = -3;
             FirstTmpBpm.Duration    = MidJson.bpm[0].Duration;
             FirstTmpBpm.Degree      = MidJson.bpm[0].Degree;
             FirstTmpBpm.Size        = MidJson.bpm[0].Size;
             FirstTmpBpm.Critical    = MidJson.bpm[0].Critical;
             FirstTmpBpm.Combination = MidJson.bpm[0].Combination;
             FirstTmpBpm.Bpm         = MidJson.bpm[0].Bpm;
             LanotaChangeBpm.Add(FirstTmpBpm);
             for (int i = 1; i < MidJson.bpm.Count; ++i)
             {
                 LanotaChangeBpm TmpBpm = new LanotaChangeBpm();
                 TmpBpm.Type        = MidJson.bpm[i].Type;
                 TmpBpm.Time        = MidJson.bpm[i].Timing;
                 TmpBpm.Duration    = MidJson.bpm[i].Duration;
                 TmpBpm.Degree      = MidJson.bpm[i].Degree;
                 TmpBpm.Size        = MidJson.bpm[i].Size;
                 TmpBpm.Critical    = MidJson.bpm[i].Critical;
                 TmpBpm.Combination = MidJson.bpm[i].Combination;
                 TmpBpm.Bpm         = MidJson.bpm[i].Bpm;
                 LanotaChangeBpm.Add(TmpBpm);
             }
         }
         else
         {
             LanotaChangeBpm FirstTmpBpm = new LanotaChangeBpm();
             FirstTmpBpm.Type = 6;
             FirstTmpBpm.Time = -3;
             FirstTmpBpm.Bpm  = 100;
             LanotaChangeBpm.Add(FirstTmpBpm);
         }
     }
     else
     {
         LanotaChangeBpm FirstTmpBpm = new LanotaChangeBpm();
         FirstTmpBpm.Type = 6;
         FirstTmpBpm.Time = -3;
         FirstTmpBpm.Bpm  = 100;
         LanotaChangeBpm.Add(FirstTmpBpm);
     }
     //Scroll
     if (MidJson.scroll != null)
     {
         if (MidJson.scroll.Count != 0)
         {
             LanotaScroll TmpScrollFirst = new LanotaScroll();
             TmpScrollFirst.Speed = MidJson.scroll[0].speed;
             TmpScrollFirst.Time  = -10;
             LanotaScroll.Add(TmpScrollFirst);
             for (int i = 1; i < MidJson.scroll.Count; ++i)
             {
                 LanotaScroll TmpScroll = new LanotaScroll();
                 TmpScroll.Speed = MidJson.scroll[i].speed;
                 TmpScroll.Time  = MidJson.scroll[i].timing;
                 LanotaScroll.Add(TmpScroll);
             }
         }
         else
         {
             LanotaScroll TmpScrollFirst = new LanotaScroll();
             TmpScrollFirst.Speed = 1;
             TmpScrollFirst.Time  = -10;
             LanotaScroll.Add(TmpScrollFirst);
         }
     }
     else
     {
         LanotaScroll TmpScrollFirst = new LanotaScroll();
         TmpScrollFirst.Speed = 1;
         TmpScrollFirst.Time  = -10;
         LanotaScroll.Add(TmpScrollFirst);
     }
     SongLength = MidJson.eos;
 }