/// <summary> /// get actual position by object /// </summary> /// <param name="field"></param> /// <param name="drawableRpHitObject"></param> /// <returns></returns> public static Vector2 FindObjectPosition(this IHasGameField field, DrawableBaseRpObject drawableRpHitObject) { if (drawableRpHitObject is DrawableRpContainerLineGroup group) { return(group.GameFieldContainer.Position); } else if (drawableRpHitObject is DrawableRpContainerLine line) { var grpupContainer = GeDrawableByRpObject <DrawableRpContainerLineGroup>(field, line.HitObject.ParentObject).GameFieldContainer; return(grpupContainer.Position + line.Position.Rotate(grpupContainer.Rotation)); } else if (drawableRpHitObject is DrawableRpContainerLineHoldObject lineHold) { //TODO : implement return(new Vector2(0, 0)); } else if (drawableRpHitObject is DrawableRpHitObject hit) { var grpupContainer = GeDrawableByRpObject <DrawableRpContainerLineGroup>(field, hit.HitObject.ParentObject.ParentObject).GameFieldContainer; return(grpupContainer.Position + hit.Position.Rotate(grpupContainer.Rotation)); } else if (drawableRpHitObject is DrawableRpHoldObject hold) { var grpupContainer = GeDrawableByRpObject <DrawableRpContainerLineGroup>(field, hold.HitObject.ParentObject.ParentObject).GameFieldContainer; return(grpupContainer.Position + hold.Position.Rotate(grpupContainer.Rotation)); } return(new Vector2(0, 0)); }
/// <summary> /// 曾加速度 /// </summary> /// <param name="drawObject"></param> public void AddDrawObject(DrawableBaseRpObject drawObject) { var drawableHitObject = drawObject as DrawableBaseRpHitableObject; AddDrawableBaseHitObject(drawableHitObject); }