Refactor course maps and travel UI
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
public enum CoursePlatformType {
|
||||
Basic,
|
||||
Jump,
|
||||
Slide,
|
||||
ForceHit
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02a1bb5c51284fd8ad76d51d8327a14c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
[Serializable]
|
||||
public class CourseStep {
|
||||
public CoursePlatformType coursePlatformType;
|
||||
public Platform.PlatformPattern platformPattern;
|
||||
public Platform.MileagePattern mileagePattern;
|
||||
public SlideObstaclePattern.SlideLayout slideLayout;
|
||||
public Platform.ItemPattern itemPattern;
|
||||
public GameManager.TutorialGuideType guideType;
|
||||
public float yPosition;
|
||||
public float spawnInterval;
|
||||
public string title;
|
||||
public string message;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 21d873850c7043ef8b2854e1a5f16d9b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,189 @@
|
||||
public static class CourseStepFactory {
|
||||
public const float GroundY = -2.4f;
|
||||
public const float AerialY = -0.85f;
|
||||
public const float BasicSpacing = 0.58f;
|
||||
public const float ActionSpacing = 0.72f;
|
||||
public const float LandingSpacing = 0.64f;
|
||||
public const float AerialSpacing = 2.05f;
|
||||
|
||||
public static CourseStep[] CreateEasyLoop() {
|
||||
return new CourseStep[] {
|
||||
Basic(),
|
||||
Jump(),
|
||||
Basic(GroundY, LandingSpacing),
|
||||
Aerial(),
|
||||
Basic(GroundY, LandingSpacing),
|
||||
Slide(SlideObstaclePattern.SlideLayout.CenterPair),
|
||||
Basic()
|
||||
};
|
||||
}
|
||||
|
||||
public static CourseStep Basic(
|
||||
float yPosition = GroundY,
|
||||
float spawnInterval = BasicSpacing,
|
||||
Platform.MileagePattern mileagePattern = Platform.MileagePattern.SafeLine,
|
||||
GameManager.TutorialGuideType guideType = GameManager.TutorialGuideType.None,
|
||||
string title = "",
|
||||
string message = "",
|
||||
Platform.ItemPattern itemPattern = Platform.ItemPattern.None) {
|
||||
return Step(
|
||||
Platform.PlatformPattern.Empty,
|
||||
mileagePattern,
|
||||
SlideObstaclePattern.SlideLayout.Random,
|
||||
guideType,
|
||||
GroundY,
|
||||
spawnInterval,
|
||||
title,
|
||||
message,
|
||||
itemPattern,
|
||||
CoursePlatformType.Basic);
|
||||
}
|
||||
|
||||
public static CourseStep Jump(
|
||||
Platform.PlatformPattern platformPattern = Platform.PlatformPattern.LowMid,
|
||||
float spawnInterval = ActionSpacing,
|
||||
GameManager.TutorialGuideType guideType = GameManager.TutorialGuideType.None,
|
||||
string title = "",
|
||||
string message = "") {
|
||||
return Step(
|
||||
platformPattern,
|
||||
Platform.MileagePattern.JumpArc,
|
||||
SlideObstaclePattern.SlideLayout.Random,
|
||||
guideType,
|
||||
GroundY,
|
||||
spawnInterval,
|
||||
title,
|
||||
message,
|
||||
Platform.ItemPattern.None,
|
||||
CoursePlatformType.Jump);
|
||||
}
|
||||
|
||||
public static CourseStep Jump(
|
||||
GameManager.TutorialGuideType guideType,
|
||||
string title,
|
||||
string message) {
|
||||
return Jump(Platform.PlatformPattern.LowMid, ActionSpacing, guideType, title, message);
|
||||
}
|
||||
|
||||
public static CourseStep Aerial(
|
||||
GameManager.TutorialGuideType guideType = GameManager.TutorialGuideType.None,
|
||||
string title = "",
|
||||
string message = "") {
|
||||
return Aerial(AerialY, AerialSpacing, guideType, title, message);
|
||||
}
|
||||
|
||||
public static CourseStep Aerial(
|
||||
float yPosition,
|
||||
float spawnInterval,
|
||||
GameManager.TutorialGuideType guideType = GameManager.TutorialGuideType.None,
|
||||
string title = "",
|
||||
string message = "") {
|
||||
return Step(
|
||||
Platform.PlatformPattern.Empty,
|
||||
Platform.MileagePattern.SafeLine,
|
||||
SlideObstaclePattern.SlideLayout.Random,
|
||||
guideType,
|
||||
yPosition,
|
||||
spawnInterval,
|
||||
title,
|
||||
message,
|
||||
Platform.ItemPattern.None,
|
||||
CoursePlatformType.Basic);
|
||||
}
|
||||
|
||||
public static CourseStep Slide(
|
||||
SlideObstaclePattern.SlideLayout slideLayout = SlideObstaclePattern.SlideLayout.CenterPair,
|
||||
float spawnInterval = ActionSpacing,
|
||||
GameManager.TutorialGuideType guideType = GameManager.TutorialGuideType.None,
|
||||
string title = "",
|
||||
string message = "") {
|
||||
return Step(
|
||||
Platform.PlatformPattern.Slide,
|
||||
Platform.MileagePattern.SlideLine,
|
||||
slideLayout,
|
||||
guideType,
|
||||
GroundY,
|
||||
spawnInterval,
|
||||
title,
|
||||
message,
|
||||
Platform.ItemPattern.None,
|
||||
CoursePlatformType.Slide);
|
||||
}
|
||||
|
||||
public static CourseStep Slide(
|
||||
GameManager.TutorialGuideType guideType,
|
||||
string title,
|
||||
string message) {
|
||||
return Slide(SlideObstaclePattern.SlideLayout.CenterPair, ActionSpacing, guideType, title, message);
|
||||
}
|
||||
|
||||
public static CourseStep ForceHit(
|
||||
GameManager.TutorialGuideType guideType = GameManager.TutorialGuideType.Damage,
|
||||
string title = "",
|
||||
string message = "",
|
||||
float spawnInterval = ActionSpacing) {
|
||||
return Step(
|
||||
Platform.PlatformPattern.ForceHit,
|
||||
Platform.MileagePattern.None,
|
||||
SlideObstaclePattern.SlideLayout.WidePair,
|
||||
guideType,
|
||||
GroundY,
|
||||
spawnInterval,
|
||||
title,
|
||||
message,
|
||||
Platform.ItemPattern.None,
|
||||
CoursePlatformType.ForceHit);
|
||||
}
|
||||
|
||||
public static CourseStep Step(
|
||||
Platform.PlatformPattern platformPattern,
|
||||
Platform.MileagePattern mileagePattern,
|
||||
SlideObstaclePattern.SlideLayout slideLayout,
|
||||
GameManager.TutorialGuideType guideType,
|
||||
float yPosition,
|
||||
float spawnInterval,
|
||||
string title = "",
|
||||
string message = "",
|
||||
Platform.ItemPattern itemPattern = Platform.ItemPattern.None,
|
||||
CoursePlatformType coursePlatformType = CoursePlatformType.Basic) {
|
||||
return new CourseStep {
|
||||
coursePlatformType = coursePlatformType,
|
||||
platformPattern = platformPattern,
|
||||
mileagePattern = mileagePattern,
|
||||
slideLayout = slideLayout,
|
||||
itemPattern = itemPattern,
|
||||
guideType = guideType,
|
||||
yPosition = yPosition,
|
||||
spawnInterval = spawnInterval,
|
||||
title = title,
|
||||
message = message
|
||||
};
|
||||
}
|
||||
|
||||
public static CourseStep[] CloneSteps(CourseStep[] source) {
|
||||
if(source == null)
|
||||
{
|
||||
return new CourseStep[0];
|
||||
}
|
||||
|
||||
CourseStep[] steps = new CourseStep[source.Length];
|
||||
|
||||
for(int i = 0; i < source.Length; i++)
|
||||
{
|
||||
CourseStep sourceStep = source[i];
|
||||
steps[i] = Step(
|
||||
sourceStep.platformPattern,
|
||||
sourceStep.mileagePattern,
|
||||
sourceStep.slideLayout,
|
||||
sourceStep.guideType,
|
||||
sourceStep.yPosition,
|
||||
sourceStep.spawnInterval,
|
||||
sourceStep.title,
|
||||
sourceStep.message,
|
||||
sourceStep.itemPattern,
|
||||
sourceStep.coursePlatformType);
|
||||
}
|
||||
|
||||
return steps;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b8e2ef0ff2346e8ab5e6d6557e41b10
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,12 @@
|
||||
public enum CourseStepKind {
|
||||
None,
|
||||
Jump,
|
||||
DoubleJumpTakeoff,
|
||||
Slide,
|
||||
ForceHit,
|
||||
HealthItem,
|
||||
InvincibleItem,
|
||||
ShieldItem,
|
||||
SpeedItem,
|
||||
MileageCardItem
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e543ce69f5964c1195ce10e5fe7e2a7e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user