Пример #1
0
 public void ActiveFigthingBossUI(EnemyHealthBarScript healthBarScript, string name)
 {
     isLastPanelBossActive = true;
     PanelBoss.SetActive(true);
     healthBarScript.IsBoss                = true;
     healthBarScript.Txt                   = healthBarBossText;
     healthBarScript.fillBar.enabled       = false;
     healthBarScript.FillBarParent.enabled = false;
     healthBarScript.fillBar               = bossFillBar;
     bossName.text = name;
 }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     rb           = GetComponent <Rigidbody2D>();
     anim         = GetComponent <Animator>();
     player       = GameObject.FindGameObjectWithTag("Player").transform;
     rend         = GetComponent <SpriteRenderer>();
     playerHealth = player.GetComponent <PlayerHealth>();
     runSpeed     = runDefSpeed;
     healthBar    = GetComponent <EnemyHealthBarScript>();
     healthBar.InitHealthBarValues(health);
     sounds = GetComponent <EnemySounds>();
 }
Пример #3
0
 // Start is called before the first frame update
 void Start()
 {
     sprite          = GetComponent <SpriteRenderer>();
     anim            = GetComponent <Animator>();
     startPos        = transform.position;
     rb              = GetComponent <Rigidbody2D>();
     playerGO        = GameObject.FindGameObjectWithTag("Player");
     playerHealth    = playerGO.GetComponent <PlayerHealth>();
     playerTransform = playerGO.transform;
     healthBar       = GetComponent <EnemyHealthBarScript>();
     healthBar.InitHealthBarValues(health);
     sounds = GetComponent <EnemySounds>();
 }
Пример #4
0
    void Start()
    {
        //camerasettings
        vcam  = GameObject.Find("CM vcam1").GetComponent <CinemachineVirtualCamera>();
        noise = vcam.GetCinemachineComponent <CinemachineBasicMultiChannelPerlin>();
        hp    = FindObjectOfType <EnemyHealthBarScript>();

        healthAmount = maxHealth;

        localScale    = transform.localScale;
        rb            = this.GetComponent <Rigidbody2D>();
        enemboxcol    = GetComponent <Collider2D>();
        enemcirclecol = GetComponent <CircleCollider2D>();
        anim          = GetComponent <Animator>();
        anim.SetBool("isWalking", true);
        sounds = GetComponents <AudioSource>();

        AttackSound = sounds[0];
        DieSound    = sounds[1];
        dirX        = -1f;
    }