merged "master" into "combining
This commit is contained in:
@@ -156,6 +156,11 @@ public class PlayerBehavior : MonoBehaviour
|
||||
stateController.spawnPoint.GetComponent<SpawnPointBehavior>().DeactivateSpawnPoint();
|
||||
col.GetComponent<SpawnPointBehavior>().ActivateSpawnPoint();
|
||||
}
|
||||
else if (col.tag == "Trumpet")
|
||||
{
|
||||
this.playerController.in_range = true;
|
||||
this.playerController.enemy = col.transform.parent.gameObject;
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerExit2D(Collider2D col)
|
||||
@@ -164,6 +169,11 @@ public class PlayerBehavior : MonoBehaviour
|
||||
{
|
||||
grappleSurface = null;
|
||||
}
|
||||
else if (col.tag == "Trumpet")
|
||||
{
|
||||
this.playerController.in_range = true;
|
||||
this.playerController.enemy = null;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCollisionEnter2D(Collision2D collision) {
|
||||
|
||||
@@ -29,6 +29,10 @@ public class PlayerMovement : MonoBehaviour
|
||||
public float LastOnWallTime { get; private set; }
|
||||
public float LastOnWallRightTime { get; private set; }
|
||||
public float LastOnWallLeftTime { get; private set; }
|
||||
|
||||
private bool trumpet = false;
|
||||
public bool in_range = false;
|
||||
public GameObject enemy;
|
||||
|
||||
//Jump
|
||||
private bool _isJumpCut;
|
||||
@@ -100,6 +104,7 @@ public class PlayerMovement : MonoBehaviour
|
||||
if (Physics2D.OverlapBox(this.transform.position, _groundCheckSize, 0, _groundLayer) && !IsJumping) //checks if set box overlaps with ground
|
||||
{
|
||||
LastOnGroundTime = Data.coyoteTime; //if so sets the lastGrounded to coyoteTime
|
||||
trumpet = true;
|
||||
}
|
||||
|
||||
//Right Wall Check
|
||||
@@ -114,7 +119,6 @@ public class PlayerMovement : MonoBehaviour
|
||||
|
||||
//Two checks needed for both left and right walls since whenever the play turns the wall checkPoints swap sides
|
||||
LastOnWallTime = Mathf.Max(LastOnWallLeftTime, LastOnWallRightTime);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region JUMP CHECKS
|
||||
|
||||
Reference in New Issue
Block a user