Beispiel #1
0
 void Start()
 {
     m_player = GameObject.FindGameObjectWithTag("Player");
     if (m_player == null)
     {
         print("Couldnt Find Player");
         Destroy(this);
         return;
     }
     pRigidbody = m_player.GetComponent <Rigidbody>();
     pAttach    = m_player.GetComponent <scr_attachRopeTo>();
     DGTT       = m_player.GetComponent <DontGoThroughThings>();
     pInput     = m_player.GetComponent <scr_ThirdPersonUserControl>();
     pMove      = m_player.GetComponent <scr_ThirdPersonCharacter>();
 }
Beispiel #2
0
 void Start()
 {
     m_Animator                = GetComponent <Animator>();
     m_Rigidbody               = GetComponent <Rigidbody>();
     m_Capsule                 = GetComponent <CapsuleCollider>();
     m_CapsuleHeight           = m_Capsule.height;
     m_CapsuleCenter           = m_Capsule.center;
     m_Player                  = this.gameObject;
     m_Rigidbody.constraints   = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ;
     m_OrigGroundCheckDistance = m_GroundCheckDistance;
     m_PSM          = GetComponent <scr_PSM>();
     m_AudioManager = Camera.main.GetComponent <scr_AudioManager>();
     m_defaultSlidingSpeedMultiplier = m_MoveSpeedMultiplier;
     m_defaultMovingTurnSpeed        = m_MovingTurnSpeed;
     m_TPUC = gameObject.GetComponent <scr_ThirdPersonUserControl>();
 }