Coder Social home page Coder Social logo

sandrofigo / delay-unity3d Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 34 KB

Simple delay class to execute code after a certain amount of time in Unity

License: The Unlicense

C# 100.00%
delays timing unity unity-3d unity2d unity3d unity-scripts unity3d-plugin utility utility-classes utility-library openupm

delay-unity3d's Introduction

Delay

Simple delay class to execute code after a certain amount of time in Unity.

openupm

Installation

There are multiple ways to install this package into your project:

  • Add it to your project through OpenUPM (recommended)
  • Add the package to the Unity package manager using the HTTPS URL of this repository (recommended)
  • Download the whole repository as a .zip and place the contents into a subfolder in your assets folder
  • Fork the repository and add it as a submodule in git

Usage

using Timing;
using UnityEngine;

public class FooBar : MonoBehaviour
{
    public void Start()
    {
        Delay.Create(1f, () => Debug.Log("I will be executed after 1 second."));
        
        Delay.WaitUntil(() => Time.time >= 5f, () => Debug.Log("I will wait until the provided condition is true."));
    }
}

Collaboration

Support this project with a ⭐️, report an issue or if you feel adventurous and would like to extend the functionality open a pull request.

delay-unity3d's People

Contributors

sandrofigo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

delay-unity3d's Issues

Stop method with null check

Add an extension method to stop a delay without having to do a null check.

// Before
delay?.Stop();

// After
delay.Stop();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.