public IEnumerator PlayWallJump() { string dir = player.getWallSensors()[0].IsWallCollide() ? "R" : "L"; anim.Play("Wall Jump" + dir, 0, 0); anim.SetBool("WallJump", true); yield return(new WaitForSeconds(0.25f)); anim.SetBool("WallJump", false); }
void FindWallSensors() { WallSensor[] sensors = player.getWallSensors(); foreach (WallSensor sensor in sensors) { if (sensor.name == "WallSensorL") { leftWallSensor = sensor; } else if (sensor.name == "WallSensorR") { rightWallSensor = sensor; } } }