예제 #1
0
 protected override void Initialization()
 {
     base.Initialization();
     movement                   = player.GetComponent <HorizontalMovement>();
     topOfLadder                = new Vector3(transform.position.x, platformCollider.bounds.max.y);
     bottomOfLadder             = new Vector3(transform.position.x, platformCollider.bounds.min.y);
     platformCollider.isTrigger = true;
 }
예제 #2
0
 //This is essentially the Start() method for all the child scripts of the Character script.
 protected virtual void Initialization()
 {
     gameFile      = PlayerPrefs.GetInt("GameFile");
     col           = GetComponent <Collider2D>();
     rb            = GetComponent <Rigidbody2D>();
     anim          = GetComponent <Animator>();
     movement      = GetComponent <HorizontalMovement>();
     jump          = GetComponent <Jump>();
     input         = GetComponent <InputManager>();
     objectPooler  = ObjectPooler.Instance;
     aimManager    = GetComponent <AimManager>();
     weapon        = GetComponent <Weapon>();
     grapplingHook = GetComponent <GrapplingHook>();
     dash          = GetComponent <Dash>();
     gameManager   = FindObjectOfType <GameManager>();
     facingLeft    = new Vector2(-transform.localScale.x, transform.localScale.y);
 }