-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: redefine some function in Prop and remove comments in PlayerLogic
- Loading branch information
Showing
10 changed files
with
52 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
using UnityEngine; | ||
|
||
namespace SWPPT3.Main.Prop | ||
{ | ||
public class MagicCircle : StatefulProp | ||
{ | ||
[SerializeField] | ||
private int stateChangeAmount; | ||
public override void StateChangeEvent() | ||
{ | ||
if (this.State == (int)StateLevel.Off) | ||
{ | ||
|
||
} | ||
else if (this.State == (int)StateLevel.Quarter) | ||
if (this.State == Full) | ||
{ | ||
|
||
} | ||
else if (this.State == (int)StateLevel.Half) | ||
else if (this.State == Off) | ||
{ | ||
|
||
} | ||
else if (this.State == (int)StateLevel.ThreeQuarters) | ||
{ | ||
} | ||
|
||
} | ||
else if (this.State == (int)StateLevel.On) | ||
{ | ||
public override void Activate() | ||
{ | ||
this.State += stateChangeAmount; | ||
} | ||
|
||
} | ||
public override void Deactivate() | ||
{ | ||
this.State -= stateChangeAmount; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
namespace SWPPT3.Main.Prop | ||
{ | ||
public enum StateLevel | ||
{ | ||
Off = 0, | ||
On = 100, | ||
Quarter = 25, | ||
Half = 50, | ||
ThreeQuarters = 75, | ||
Full = 100 | ||
} | ||
public abstract class StatefulProp : PropBase | ||
{ | ||
protected const int On = 1; | ||
protected const int Off = 0; | ||
protected const int Full = 100; | ||
|
||
public int StateChangeAmount; | ||
|
||
public int State { get; set; } = 0; | ||
public abstract void StateChangeEvent(); | ||
|
||
public virtual void Activate() | ||
{ | ||
State = On; | ||
} | ||
|
||
public virtual void Deactivate() | ||
{ | ||
State = Off; | ||
} | ||
} | ||
|
||
} |