IEnumerator DelayAction()
    {
        IsActionPending = true;
        yield return(new WaitForSeconds(delay));

        IsActionPending = false;
        target.Act();
    }
 void Update()
 {
     if (Input.GetButtonUp(ButtonName))
     {
         Action.Act();
     }
 }
示例#3
0
 public void Trigger()
 {
     if (action)
     {
         action.Act();
     }
 }
 public override void Act()
 {
     if (Random.Range(0, 100) <= PercentageChance)
     {
         Action.Act();
     }
 }
示例#5
0
    IEnumerator DelayThenTick()
    {
        yield return(new WaitForSeconds(TickDelay));

        Action.Act();
        StartCoroutine(DelayThenTick());
    }
 public override void Act()
 {
     if (!used)
     {
         used = true;
         Action.Act();
     }
 }
 public override void Act()
 {
     if (!InCooldown)
     {
         Action.Act();
         InCooldown = true;
         StartCoroutine(ClearCooldown());
     }
 }
    IEnumerator DelayAction(int repeatsLeft)
    {
        yield return(new WaitForSeconds(DelayBetweenActions));

        target.Act();
        repeatsLeft--;
        if (repeatsLeft > 0)
        {
            StartCoroutine(DelayAction(repeatsLeft));
        }
    }
 public override void Act()
 {
     if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
     {
         ShiftAction.Act();
     }
     else
     {
         StandardAction.Act();
     }
 }
 public override void Act()
 {
     toggle = !toggle;
     if (toggle)
     {
         enableAction.Act();
     }
     else
     {
         disableAction.Act();
     }
 }
 public override void Act()
 {
     Toggled = !Toggled;
     if (Toggled)
     {
         EnabledAction.Act();
     }
     else
     {
         DisabledAction.Act();
     }
 }
    IEnumerator DelayAction()
    {
        yield return(new WaitForSeconds(Delay));

        Action.Act();
    }
    IEnumerator DelayAction()
    {
        yield return(new WaitForSeconds(delay));

        target.Act();
    }
示例#14
0
 private void Update()
 {
     Action.Act();
 }
示例#15
0
 private void Start()
 {
     Action.Act();
 }
 private void OnTriggerEnter(Collider other)
 {
     Action.Act();
 }