Наследование: UnityEngine.MonoBehaviour
Пример #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;
 }
Пример #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;
    }
Пример #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;
    }
Пример #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> ();
 }
Пример #6
0
 void Start()
 {
     cc = GetComponent<CharacterController2D>();
     sr = GetComponentInChildren<SpriteRenderer>();
     rb = GetComponent<Rigidbody2D>();
     anim = GetComponentInChildren<Animator>();
     tSprite = transform.Find("sprite");
 }
Пример #7
0
    private int jumpCount = 0;     // to disallow triple jump

    void Awake()
    {
        _controller = GetComponent <Prime31.CharacterController2D> ();
        _animator   = GetComponent <Animator> ();
    }
Пример #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>();
	}