protected virtual void Start() { _photonView = PhotonView.Get(this); _animator = GetComponent <Animator> (); _rigidbody = GetComponent <Rigidbody> (); _capsule = GetComponent <CapsuleCollider> (); _hsc = GetComponent <HumanoidSpeedComponent> (); _hangHandler = GetComponentInChildren <HangHandler> (); if (!_hangHandler) { // print ("HangHandler not found"); } _capsuleHeight = _capsule.height; _capsuleCenter = _capsule.center; _rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ; _origGroundCheckDistance = _groundCheckDistance; _hashFoward = AnimationHashHelper.PARAM_FORWARD; _hashOnGround = AnimationHashHelper.PARAM_ON_GROUND; _hashStrafe = AnimationHashHelper.PARAM_STRAFE; _hashCrouch = AnimationHashHelper.PARAM_CROUCH; _hashJump = AnimationHashHelper.PARAM_JUMP; _hashStateHangIdle = AnimationHashHelper.STATE_HANG_IDLE; }
public override void Initialize(GameObject unitObject) { base.Initialize(unitObject); _speeder = unitObject.GetComponent <HumanoidSpeedComponent>(); }