Exemple #1
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);
 }
Exemple #2
0
 protected virtual void Start()
 {
     player        = GameObject.FindWithTag("Player");
     grapplingHook = player.GetComponent <GrapplingHook>();
 }