Exemple #1
0
 void OnEnable()
 {
     //Asign the objects to variables
     player         = GameObject.FindGameObjectWithTag("Player");
     dashDampScript = player.GetComponent <DashDamp>();
     bossLifeScript = bossContainer.GetComponent <BossLife>();
 }
 void Start()
 {
     rigid                   = GetComponent <Rigidbody2D>();
     player                  = GameObject.FindGameObjectWithTag("Player");
     dashDampScript          = player.GetComponent <DashDamp>();
     spriteRendererComponent = GetComponent <SpriteRenderer>();
     col = GetComponent <BoxCollider2D>();
 }
Exemple #3
0
 void Start()
 {
     inputManager       = GameObject.Find("InputManager");
     inputManagerScript = inputManager.GetComponent <InputManager>();
     rb                   = GetComponent <Rigidbody2D>();
     animatorNames        = GetComponent <AnimatorNames>();
     playerMovementScript = GetComponent <PlayerMovement>();
     dashDampScript       = GetComponent <DashDamp>();
     audioSourceComponent = GetComponent <AudioSource>();
     dashTime             = startDashTime;
 }
Exemple #4
0
    private void Start()
    {
        //Assign components to variables
        rigid  = GetComponent <Rigidbody2D>();
        player = GameObject.FindGameObjectWithTag("Player").transform;
        playerDetectorScript    = playerDetector.GetComponent <PlayerDetector>();
        rightSideDetectorScript = rightDetector.GetComponent <EnemySideDetector>();
        leftSideDetectorScript  = leftDetector.GetComponent <EnemySideDetector>();
        dashDampScript          = player.GetComponent <DashDamp>();
        inhaleScript            = player.GetComponent <Inhale>();
        playerRigidBody         = player.GetComponent <Rigidbody2D>();
        enemyHeadColliderScript = GetComponentInChildren <EnemyHeadCollider>();
        playerLifeSystem        = player.GetComponent <LifeSystem>();

        //Get the Scale of the Object;
        objectScale = transform.localScale;

        //Invoke the Jump method
        InvokeRepeating("Jump", 0, jumpTimeStep);
    }