Implement TargetingPolicy, Cover can only target other allies
This commit is contained in:
parent
611601934d
commit
3e0004d4cb
21 changed files with 151 additions and 26 deletions
|
|
@ -22,7 +22,7 @@ public class BattleParticipantSprite : MonoBehaviour
|
|||
|
||||
// Update is called once per frame
|
||||
void Update() {
|
||||
if (colorChanged && !this.playerControls.IsTargeting()) {
|
||||
if (colorChanged && !this.playerControls.CouldTarget(participant)) {
|
||||
OnMouseExit();
|
||||
}
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ public class BattleParticipantSprite : MonoBehaviour
|
|||
private bool colorChanged;
|
||||
|
||||
void OnMouseEnter() {
|
||||
if (this.playerControls.IsTargeting()) {
|
||||
if (this.playerControls.CouldTarget(participant)) {
|
||||
SpriteRenderer sprite = GetComponent<SpriteRenderer>();
|
||||
this.savedColor = sprite.color;
|
||||
sprite.color = Color.Lerp(this.savedColor, Color.white, .5f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue