Inheritance: UnityEngine.MonoBehaviour
 protected void Awake()
 {
     controller = this.GetComponent<Prime31.CharacterController2D>();
     myPhotonView = this.GetComponent<PhotonView>();
     playerInput = this.GetComponent<InputHandler>();
     myCollider = this.GetComponent<BoxCollider2D>();
     moveState = moveStates.firstJump;
 }
Beispiel #2
0
    void Awake()
    {
        _animator   = GetComponent <Animator>();
        _controller = GetComponent <Prime31.CharacterController2D>();

        // listen to some events for illustration purposes
        _controller.onControllerCollidedEvent += onControllerCollider;
        _controller.onTriggerEnterEvent       += onTriggerEnterEvent;
        _controller.onTriggerExitEvent        += onTriggerExitEvent;
    }
Beispiel #3
0
    void Awake()
    {
        /* IMPORTANT */
        Application.targetFrameRate = 60;

        m_controller = GetComponent <Prime31.CharacterController2D>();

        // listen to some events for illustration purposes
        m_controller.onControllerCollidedEvent += onControllerCollider;
        m_controller.onTriggerEnterEvent       += onTriggerEnterEvent;
        m_controller.onTriggerExitEvent        += onTriggerExitEvent;

        /* Setting Up Gravity */
        m_gravity        = gravity;
        m_originalScale  = spriteChild.localScale;
        m_animator       = spriteChild.GetComponent <Animator>();
        m_currentState   = EPlayerState.Idle;
        m_audioSource    = GetComponent <AudioSource>();
        m_lastCheckpoint = transform.position;
    }
Beispiel #4
0
 void Start()
 {
     charController = GetComponent <Prime31.CharacterController2D>();
     charController.warpToGrounded();
     print(charController.isGrounded);
 }
 private void Awake()
 {
     _animator           = transform.Find("renderer").GetComponent <Animator> ();
     _platformController = GetComponent <Prime31.CharacterController2D> ();
 }
Beispiel #6
0
 void Start()
 {
     cc = GetComponent<CharacterController2D>();
     sr = GetComponentInChildren<SpriteRenderer>();
     rb = GetComponent<Rigidbody2D>();
     anim = GetComponentInChildren<Animator>();
     tSprite = transform.Find("sprite");
 }
Beispiel #7
0
    private int jumpCount = 0;     // to disallow triple jump

    void Awake()
    {
        _controller = GetComponent <Prime31.CharacterController2D> ();
        _animator   = GetComponent <Animator> ();
    }
	// Use this for initialization
	void Start () {
        myCharacterController = this.GetComponent<Prime31.CharacterController2D>();
        myPlayerCharacter = this.GetComponent<PlayerCharacter>();
        myAnimationController = this.GetComponent<PlayerAnimationController>();
        myColliderController = this.GetComponent<PlayerColliderController>();
	}