Newer
Older
Will
committed
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SettingsPersistance : MonoBehaviour
{
public static SettingsPersistance INSTANCE;
[HideInInspector] public Difficulty difficulty;
Will
committed
[HideInInspector] public int turnDuration;
[HideInInspector] public int maxPoints;
void Awake()
{
if (INSTANCE == null)
{
DontDestroyOnLoad(gameObject);
INSTANCE = this;
}
if (INSTANCE != this)
{
Destroy(gameObject);
}
defaultValues();
}
private void defaultValues()
{
Will
committed
turnDuration = 8;
maxPoints = 3;
}
}
public abstract class Difficulty
Will
committed
{
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
protected float costModifier;
protected float speed;
protected float jumpForce;
protected float force;
protected float maxStamina;
protected float speedModifier;
public float getCostModifier()
{
return costModifier;
}
public float getSpeed()
{
return speed;
}
public float getJumpForce()
{
return jumpForce;
}
public float getForce()
{
return force;
}
public float getMaxStamina()
{
return maxStamina;
}
public float getSpeedModifier()
{
return speedModifier;
}
}
public class Easy : Difficulty
{
public Easy()
{
costModifier = 1;
speed = 4;
jumpForce = 5;
force = 0.8f;
maxStamina = 20;
speedModifier = 2;
}
}
public class Normal : Difficulty
{
public Normal()
{
costModifier = 2;
speed = 3;
jumpForce = 4;
force = 0.8f;
maxStamina = 15;
speedModifier = 1.5f;
}
}
public class Hard : Difficulty
{
public Hard()
{
costModifier = 3;
speed = 2;
jumpForce = 3;
force = 0.5f;
maxStamina = 15;
speedModifier = 1.2f;
}