void Start()
 {
     damageTypeManager = DamageTypeManager.instance;
     damageTypeManager.AddDamageTypeSelectionChangeListener(UpdateDamageTypeLabel);
     damageTypeAdditionalLabel = GetComponent<Text>();
     UpdateDamageTypeLabel();
 }
 public void takeDamage(float damage, DamageTypeManager.DamageType damageType)
 {
     if (damageType == DamageTypeManager.DamageType.Antimatter){
         slowStartTime = Time.time;
     }
     if(ionShield != null){
         damage = ionShield.TakeDamage(damage);
     }
     currentHp -= damage;
     if (healthChanged != null){
         healthChanged();
     }
     updateHealthBar();
     if (currentHp <=0){
         Die();
     }
 }
Ejemplo n.º 3
0
        public GameEngine(ILogHelper log)
        {
            Definer.Instance().Init(this);
            _propertyManager        = new PropertyManager();
            _propertyManager.Engine = this;

            _skillManager        = new SkillManager();
            _skillManager.Engine = this;

            _coreManager        = new CoreManager();
            _coreManager.Engine = this;

            _playerManager = new PlayerManager();

            _damageTypeManager        = new DamageTypeManager();
            _damageTypeManager.Engine = this;

            _statusManager        = new StatusManager();
            _statusManager.Engine = this;

            _statManager = new StatManager(this);

            _playerManager.Engine = this;
            _classManager         = new ClassManager();
            _classManager.Engine  = this;
            _duelManager          = new DuelManager();
            _duelManager.Engine   = this;

            _log              = log;
            Players           = new Dictionary <string, Entity>();
            Enemies           = new Dictionary <string, Entity>();
            Timer             = new MockTimer();
            Sanit             = new Sanitizer(this);
            DeclaredVariables = new Dictionary <string, MeVariable>();

            commandsQueue = new ConcurrentQueue <Command>();
            _nextSave     = Timer.GetFuture(GameConstants.SAVE_INTERVAL);
        }
    // Use this for initialization
    void Start()
    {
        map = Map.instance;
        playerMoney = PlayerMoney.instance;
        damageTypeManager = DamageTypeManager.instance;

        towerCostLabel = transform.GetComponentInChildren<Text>();
        towerCostLabel.text = towerCost.ToString();
        playerMoney.AddOnMoneyChangeListener(UpdateTowerCostLabelStatus);
        buttonCenterRenderer = GetComponent<SpriteRenderer>();
        buttonGlowRenderer = transform.Find("Glow").GetComponent<SpriteRenderer>();
        damageTypeManager.AddDamageTypeSelectionChangeListener(ChangeTowerDamageType);
        damageTypeManager.SelectCurrentDamageType(DamageTypeManager.DamageType.Antimatter);
    }
 void Awake()
 {
     instance = this;
 }