public void Initialize(Player player, Rigidbody rb, CapsuleCollider worldCollider, GameObject head, PlayerHealthNEW health) { this.player = player; this.rb = rb; this.col = worldCollider; this.head = head; this.health = health; contactPoints = new List <ContactPoint>(); SetColliderHeight(normalHeight); //TODO load from playerprefs later (if i do a half life style campaign) jumpSpeed = Mathf.Sqrt(2f * normalGravity * moveJumpHeight); collisionLayerMaskForRaycasting = LayerMaskUtils.CreateMask(this.rb.gameObject.layer); collisionLayerMaskForRaycasting &= ~LayerMask.GetMask("Water"); debugInfo = ""; }
void Reset() { movement = GetComponentInChildren <PlayerMovementNEW>(); view = GetComponentInChildren <PlayerViewNEW>(); health = GetComponentInChildren <PlayerHealthNEW>(); }