Example #1
0
    private IEnumerator HealRoutine()
    {
        while (true)
        {
            yield return(new WaitForSeconds(1f));

            if (isPowered)
            {
                room.HurtPresentHScr(hpPS);
            }
        }
    }
Example #2
0
    /*
     *  private void OnTriggerEnter2D(Collider2D _col)
     *  {
     *  Debug.LogError("ahhhh collisions in the mornin!");
     *  //Debug.LogError("roomPos: " + gridPos.X + ", " + gridPos.Y);
     *
     *  //CouchCrewScript _couchCrew = _col.GetComponent<CouchCrewScript>();
     *  HealthScript _hScr = _col.GetComponent<HealthScript>();
     *
     *  inRoomHScr.Add(_hScr);
     *  }
     *
     * private void OnTriggerExit2D(Collider2D _col)
     * {
     *  Debug.LogError("getouttahear!");
     *
     *  //Debug.LogError("ahhhh collisions in the mornin!");
     *  //CouchCrewScript _couchCrew = _col.GetComponent<CouchCrewScript>();
     *  HealthScript _hScr = _col.GetComponent<HealthScript>();
     *
     *  inRoomHScr.Remove(_hScr);
     * }
     */


    public void HurtPresentHScr(int _amount)
    {
        if (isOrigin)
        {
            foreach (var _hScr in inRoomHScr)
            {
                _hScr.TakeCrewDamage(_amount);
            }
        }
        else
        {
            originScr.HurtPresentHScr(_amount);
        }

        //Debug.LogError("ouch");

        /*
         * foreach (var _hScr in inRoomHScr) {
         *  _hScr.TakeCrewDamage(_amount);
         * }
         */
    }