Exemplo n.º 1
0
    void OnClose(Unit u)
    {
        target_enemy.OnIdentify -= OnClose;

        StartCoroutine(M_Math.ExecuteDelayed(3f, () => ToastNotification.SetToastMessage1("A prisoner?! He must have escaped from the mines.")));
        StartCoroutine(M_Math.ExecuteDelayed(4f, Complete));
    }
Exemplo n.º 2
0
 void Show()
 {
     gameObject.SetUIAlpha(0);
     StartCoroutine(M_Math.ExecuteDelayed(m_Item.GetIndex() == 0 ? 0.5f : 4f,
                                          () => StartCoroutine(M_Extensions.YieldT((f) => { gameObject.SetUIAlpha(f); }, 0.5f))
                                          ));
 }
Exemplo n.º 3
0
 void OnStatUpdated(Stat s)
 {
     if (s.StatType == StatType.adrenaline && m_action.GetRequirements().Select(si => si.StatType).ToList().Contains(s.StatType))
     {
         M_Math.ExecuteDelayed(StatUpdateDelay, SetBaseState);
     }
 }
Exemplo n.º 4
0
    public override void Remove()
    {
        m_Item.OnCancel   -= Remove;
        m_Item.OnComplete -= Updated;


        StartCoroutine(M_Math.ExecuteDelayed(1.5f, Removed));
    }
Exemplo n.º 5
0
 void CheckSpeech(Unit u, string[] texts, string arg)
 {
     if (u == m_Unit)
     {
         StopAllCoroutines();
         TF.text = string.Format(texts[0], arg);
         TextPlate.SetActive(true);
         StartCoroutine(M_Math.ExecuteDelayed(texts.Length * 0.5f + 2.5f, () => TextPlate.SetActive(false)));
     }
 }
Exemplo n.º 6
0
 void TriggerDelayed(Speech speech, float delay)
 {
     if (speech != null)
     {
         StartCoroutine(M_Math.ExecuteDelayed(delay, () => TriggerSpeech(m_Unit, speech.Lines)));
     }
     else
     {
         MDebug.LogWarning("speech not found");
     }
 }
Exemplo n.º 7
0
    public void OnLoot(Unit _u)
    {
        int lootable_amount = GetLootableAmount(_u);

        if (lootable_amount > 0)
        {
            item_lootable.SetCount(item_lootable.GetCount() - lootable_amount);
            GetInventory(_u).ModifyItem(item_lootable.GetItemType(), lootable_amount);
        }

        crate.GetComponent <Animator>().SetTrigger("bOpened");

        if (item_lootable.GetCount() == 0)
        {
            StartCoroutine(M_Math.ExecuteDelayed(2f, RemoveLoot));
            // MDebug.Log("^loot removing loot soon");
        }
    }
Exemplo n.º 8
0
 public static void ExecuteDelayed(this MonoBehaviour comp, float time, System.Action func)
 {
     comp.StartCoroutine(M_Math.ExecuteDelayed(time, func));
 }
Exemplo n.º 9
0
 void Removed()
 {
     StartCoroutine(M_Extensions.YieldT((f) => { gameObject.SetUIAlpha(1 - f); }, 0.5f));
     StartCoroutine(M_Math.ExecuteDelayed(0.5f, () => { OnRemoved.AttemptCall(); Destroy(this.gameObject); }));
 }