// // LifeCycles // protected override void Awake() { this.onTriggerHit = new RaycastHit2DEvent(); this.onColliderHit = new RaycastHit2DEvent(); base.Awake(); this.collisions.facedDir = 1; }
void onRaycastHit2D(RaycastHit2DEvent cEvent) { Debug.Log("####RaycastHit2DEvent"); if (cEvent.raycast.label.Equals("Ground")) { onSlope = onGround && Math.Abs(Vector2.Angle(Vector2.up, cEvent.hit.normal)) > behaviour.maxSlope; } Debug.Log("Normal Angle: " + Math.Abs(Vector2.Angle(Vector2.up, cEvent.hit.normal))); // TODO can Wall Jump ? }