Example #1
0
    void Start()
    {
        instance   = this;
        heartStack = new Stack <GameObject>();
        Recover(maxHp);

        player = GameObject.FindGameObjectWithTag("Player");
    }
Example #2
0
    private void Awake()
    {
        sonucPanel.GetComponent <RectTransform>().localScale = Vector3.zero;
        kalanhp = 3;

        hp = Object.FindObjectOfType <HpManager>();
        hp.KalanHitPoint(kalanhp);
        rm = Object.FindObjectOfType <ResultManager>();

        audioSource = GetComponent <AudioSource>();
    }
 void Start()
 {
     MainCamera.cam.transform.position = new Vector3(0f, 0f, -10f);
     HpManager.Init();
     if (StoneManager.stone < 20)
     {
         StoneManager.stone = 20;
         StoneManager.ReloadStone(0);
     }
     delay = 2f;
     SoundBackground.Stop();
 }
 void LostHp(int n)
 {
     if (HpManager.LostHp(n))
     {
         Dead();
         return;
     }
     isImmune     = true;
     isShowSprite = true;
     timerImmune  = 1f;
     SoundEffect.PlayLostHp();
 }
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (isVisible)
     {
         if (collision.CompareTag(tagPlayer))
         {
             HpManager.IncreaseMaxHp();
             Destroy(parent);
             SoundEffect.PlayEatPhoenix();
         }
     }
     else
     {
         if (collision.CompareTag(tagBullet))
         {
             isVisible             = true;
             spriteRenderer.sprite = sprite;
             Destroy(collision.gameObject);
             SoundEffect.PlayItemShow();
         }
     }
 }
Example #6
0
 private void Awake()
 {
     hpManager = GetComponent <HpManager>();
     hpManager.OnDestroyCallback += GameOver;
 }
Example #7
0
 private void Awake()
 {
     hpManager = GetComponent <HpManager>();
 }
Example #8
0
 private void Start()
 {
     HpManager.ResetReload();
     delay = 2f;
 }
Example #9
0
 // Use this for initialization
 void Start()
 {
     towerRightHP = 1000;
     towerRight   = GameObject.Find("TowerRight");
     hpManager    = GetComponent <HpManager>();
 }
Example #10
0
 void Start()
 {
     hp = new HpManager(100f);
 }
Example #11
0
 private void Awake()
 {
     instance = this;
 }
Example #12
0
 private void Awake()
 {
     attackManager = GetComponent <AttackManager>();
     hpManager     = GetComponent <HpManager>();
 }
Example #13
0
 private void Awake()
 {
     hpManager   = GetComponent <HpManager>();
     goldManager = GetComponent <GoldMine>();
 }