Inheritance: UnityEngine.MonoBehaviour
Ejemplo n.º 1
0
 protected void Awake()
 {
     controller = this.GetComponent<Prime31.CharacterController2D>();
     myPhotonView = this.GetComponent<PhotonView>();
     playerInput = this.GetComponent<InputHandler>();
     myCollider = this.GetComponent<BoxCollider2D>();
     moveState = moveStates.firstJump;
 }
Ejemplo n.º 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;
    }
Ejemplo n.º 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;
    }
Ejemplo n.º 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> ();
 }
Ejemplo n.º 6
0
 void Start()
 {
     cc = GetComponent<CharacterController2D>();
     sr = GetComponentInChildren<SpriteRenderer>();
     rb = GetComponent<Rigidbody2D>();
     anim = GetComponentInChildren<Animator>();
     tSprite = transform.Find("sprite");
 }
Ejemplo n.º 7
0
    private int jumpCount = 0;     // to disallow triple jump

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