示例#1
0
 private void PayerBall_Hit(GameObject sender, Collision collision)
 {
     if (collision.gameObject.tag.Equals(Tags.Wall.GetStringValue()) || collision.gameObject.tag.Equals(Tags.Ball.GetStringValue()))
     {
         Debug.Log(collision.gameObject);
         HitObjectList.Add(collision.gameObject);
     }
 }
示例#2
0
        public void Match(string line)
        {
            if (HitObjectList == null)
            {
                HitObjectList = new List <RawHitObject>();
            }

            string[] param = line.Split(',');

            var x        = int.Parse(param[0]);
            var y        = int.Parse(param[1]);
            var offset   = int.Parse(param[2]);
            var type     = (RawObjectType)Enum.Parse(typeof(RawObjectType), param[3]);
            var hitsound = (HitsoundType)Enum.Parse(typeof(HitsoundType), param[4]);

            var notImplementedInfo = string.Join(",", param.Skip(5));
            var hitObject          = new RawHitObject
            {
                X        = x,
                Y        = y,
                Offset   = offset,
                RawType  = type,
                Hitsound = hitsound
            };

            if ((type & RawObjectType.Circle) == RawObjectType.Circle)
            {
                ConvertToCircle(hitObject, notImplementedInfo);
            }
            else if ((type & RawObjectType.Slider) == RawObjectType.Slider)
            {
                ConvertToSlider(hitObject, notImplementedInfo);
            }
            else if ((type & RawObjectType.Spinner) == RawObjectType.Spinner)
            {
                ConvertToSpinner(hitObject, notImplementedInfo);
            }
            else if ((type & RawObjectType.Hold) == RawObjectType.Hold)
            {
                ConvertToHold(hitObject, notImplementedInfo);
            }

            HitObjectList.Add(hitObject);
        }
示例#3
0
        public override void Match(string line)
        {
            string[] param = line.SpanSplit(",");

            var x        = int.Parse(param[0]);
            var y        = int.Parse(param[1]);
            var offset   = int.Parse(param[2]);
            var type     = (RawObjectType)Enum.Parse(typeof(RawObjectType), param[3]);
            var hitsound = (HitsoundType)Enum.Parse(typeof(HitsoundType), param[4]);
            var others   = string.Join(",", param.Skip(5));

            var hitObject = new RawHitObject
            {
                X        = x,
                Y        = y,
                Offset   = offset,
                RawType  = type,
                Hitsound = hitsound
            };

            switch (hitObject.ObjectType)
            {
            case HitObjectType.Circle:
                ToCircle(hitObject, others);
                break;

            case HitObjectType.Slider:
                ToSlider(hitObject, others);
                break;

            case HitObjectType.Spinner:
                ToSpinner(hitObject, others);
                break;

            case HitObjectType.Hold:
                ToHold(hitObject, others);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            HitObjectList.Add(hitObject);
        }