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

        player = GameObject.FindGameObjectWithTag("Player");
    }
示例#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();
 }
示例#5
0
 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();
         }
     }
 }
示例#6
0
 private void Awake()
 {
     hpManager = GetComponent <HpManager>();
     hpManager.OnDestroyCallback += GameOver;
 }
示例#7
0
 private void Awake()
 {
     hpManager = GetComponent <HpManager>();
 }
示例#8
0
 private void Start()
 {
     HpManager.ResetReload();
     delay = 2f;
 }
示例#9
0
 // Use this for initialization
 void Start()
 {
     towerRightHP = 1000;
     towerRight   = GameObject.Find("TowerRight");
     hpManager    = GetComponent <HpManager>();
 }
示例#10
0
 void Start()
 {
     hp = new HpManager(100f);
 }
示例#11
0
 private void Awake()
 {
     instance = this;
 }
示例#12
0
 private void Awake()
 {
     attackManager = GetComponent <AttackManager>();
     hpManager     = GetComponent <HpManager>();
 }
示例#13
0
 private void Awake()
 {
     hpManager   = GetComponent <HpManager>();
     goldManager = GetComponent <GoldMine>();
 }