Exemple #1
0
    private void Start()
    {
        animator  = GetComponent <Animator>();
        rBody     = GetComponent <Rigidbody2D>();
        trackerPU = FindObjectOfType <PowerUpTracker>();

        startPos = transform.position;
    }
 private void Awake()
 {
     m_animator = GetComponentInChildren <Animator>();
     m_powerUpBoxesInDistance = new List <PowerUpBox>();
     m_navMeshAgent           = GetComponent <NavMeshAgent>();
     m_rigibody             = GetComponent <Rigidbody>();
     m_taggingIdentifier    = GetComponent <TaggingIdentifier>();
     m_powerUpTracker       = GetComponent <PowerUpTracker>();
     m_rigibody.isKinematic = true;
 }
Exemple #3
0
    // Start is called before the first frame update
    void Start()
    {
        rBody        = GetComponent <Rigidbody2D>();
        minY         = GameObject.Find("MinY").GetComponent <Transform>();
        trackerPU    = GameObject.Find("PowerUpController").GetComponent <PowerUpTracker>();
        trackerScore = GameObject.Find("GameController").GetComponent <ScoreCounter>();
        colliderPU   = GetComponent <Collider2D>();
        audioSource  = GetComponent <AudioSource>();

        audioSource.Play();
    }
Exemple #4
0
 // Update is called once per frame
 void Update()
 {
     tracker = transform.GetComponent <PowerUpTracker>();
     if (Input.GetKeyDown(KeyCode.Q))
     {
         tracker.UseItem1();
     }
     else if (Input.GetKeyDown(KeyCode.W))
     {
         tracker.UseItem2();
     }
 }
    private void Start()
    {
        playerDeath = GetComponent <PlayerDeath>();
        trackerPU   = FindObjectOfType <PowerUpTracker>();

        bottomBoundary  = GameObject.Find("MinY");
        topLeftBoundary = GameObject.Find("MinXMaxY");

        isGrounded  = true;
        isJumping   = false;
        timeCounter = jumpTime;

        horiz = 0.1f;
    }
 // Start is called before the first frame update
 void Start()
 {
     trackerPU = FindObjectOfType <PowerUpTracker>();
 }
 private void Start()
 {
     trackerScore = FindObjectOfType <ScoreCounter>();
     trackerPU    = FindObjectOfType <PowerUpTracker>();
     boxes        = FindObjectOfType <Boxes>();
 }