Exemple #1
0
        public void UpdateButtonText()
        {
            float  magnitude     = InfoPool.Request <float>("MousePositionMagnitude");
            string magnitudeText = "magnitude: " + (Mathf.RoundToInt(magnitude * 10) / 10f).ToString();

            buttonText.text = magnitudeText;
            Debug.Log(magnitudeText);
        }
Exemple #2
0
    protected override void DefaultAction()
    {
        BattlefieldUnits battlefieldUnits = InfoPool.Request <BattlefieldUnits>("Battlefield units");

        foreach (UnitController unit in battlefieldUnits.Units)
        {
            unit.Health -= 1;
        }

        EventPool.Trigger(EventTypes.ActionNoTarget, _avatarController.Player);
        gameObject.SetActive(false);
    }
    protected override void DefaultAction()
    {
        BattlefieldUnits battlefieldUnits = InfoPool.Request <BattlefieldUnits>("Battlefield units");

        foreach (UnitController unit in battlefieldUnits.UnitsOf(_avatarController.Player))
        {
            UnitController sameStupidUnit = unit;
            sameStupidUnit.Attack += 1;
            sameStupidUnit.StatusEffects.Add(new StatusEffect
            {
                Type         = StatusEffectType.AttackUp,
                OwnTurns     = -1,
                GlobalTurns  = 1,
                RemoveEffect = delegate { sameStupidUnit.Attack -= 1; }
            });
        }

        EventPool.Trigger(EventTypes.ActionNoTarget, _avatarController.Player);
        //gameObject.SetActive(false);
    }
Exemple #4
0
    protected override void DefaultAction()
    {
        BattlefieldUnits battlefieldUnits = InfoPool.Request <BattlefieldUnits>("Battlefield units");

        foreach (UnitController unit in battlefieldUnits.UnitsOf(_unitController.PlayersArmy))
        {
            UnitController sameStupidUnit = unit;
            sameStupidUnit.Initiative += Increase;

            sameStupidUnit.StatusEffects.Add(new StatusEffect
            {
                Type         = StatusEffectType.Eager,
                OwnTurns     = Duration,
                GlobalTurns  = -1,
                RemoveEffect = () => sameStupidUnit.Initiative -= Increase
            });
        }

        EventPool.Trigger(EventTypes.ActionNoTarget, _unitController.PlayersArmy);
    }
Exemple #5
0
    void DisplayUnreadMessages()
    {
        var messages = InfoPool.Request <List <Message> >("unread_messages");

        MessageCount.text = messages.Count > 9 ? "9+" : messages.Count.ToString();
    }
Exemple #6
0
 protected override void Start()
 {
     base.Start();
     _defendBonus = InfoPool.Request <int>("defend bonus");
 }