Ejemplo n.º 1
0
 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 = "";
 }
Ejemplo n.º 2
0
 void Reset()
 {
     movement = GetComponentInChildren <PlayerMovementNEW>();
     view     = GetComponentInChildren <PlayerViewNEW>();
     health   = GetComponentInChildren <PlayerHealthNEW>();
 }