Giter Club home page Giter Club logo

beauroutine's People

Contributors

beauchesnefilament avatar beauprime avatar shillysit avatar st0nerhat avatar tlauterbach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beauroutine's Issues

NullReferenceException when using Combine

I'm having trouble running a Combined IEnumerator, I get this error message when I run it.
image
I'm trying this repository for the first time so there might be something obvious that I'm missing

How to wait for Input.GetMouseButtonDown

Hi @BeauchesneFilament!
Firstly, thank so much for such an awesome project! It is very clean and new way to code unity that I love so much!
From your example, I see some extension like:
yield return m_RestartButton.onClick.WaitForInvoke();
Now I want to wait for the user to click on the scene. I am thinking about the wait for Input.GetMouseButtonDown but I do not know how to get this
Can you give me an example of how to handle that?
Thank so much!

Executing routines in edit mode?

Hey there,
I am quite impressed at all the things it looks like this package is capable of. Seems like it might be a great choice. I seem to be having a bit of an issue, though. What lead me to find this package was I am trying to do some light tweening at edit time in the scene view. I am trying to make it so when I click on items, such as my waypoint indicators in the sceneview that they animate a bit.

I first tried to use DoTween, but it just doesn't do well outside of playmode. So then I tried implementing this light package that uses normal coroutines which almost seemed like it was going to work. I clicked on a waypoint and it would begin to animate for about 1/4 of a second and then stop. I know the animation was still going because if I manually moved something else around while it was running, the waypoint would animate like it should, but I believe that since it was using normal coroutines, they don't force a sceneview repaint like moving something manually does.

Which is what lead me here, I was hoping that something that was outside of the standard coroutine might be just the thing I needed to bring this all together. The first thing I tried was taking the tween package I was currently trying out and simply replacing it's "StartCoroutine" with a BeauRoutine as seen below:

Excerpt from tween library
    [ExecuteInEditMode]
...
        private Routine routine;

        protected virtual void Init()
        {
            m_Tween = new Tweener<Vector3>(GenericKeys(keys), duration, delay, wrap);
            if (m_Tween.Loop != null)
            {
                m_Tween.OnSetValue += OnSetValue;
                m_Tween.OnMoveValue += OnMoveValue;
                // StartCoroutine(m_Tween.Loop);
                routine = Routine.Start(m_Tween.Loop); // Swapping in BeauRoutine
            }
        }

        protected virtual void Dispose()
        {
            if (m_Tween.Loop != null)
            {
                m_Tween.OnSetValue -= OnSetValue;
                m_Tween.OnMoveValue -= OnMoveValue;
                // StopCoroutine(m_Tween.Loop);
                routine.Stop();
            }
        }

Unfortunately though, I tested that out, and at the point in which the prior coroutine would do the partial tween for 1/4 of a second, I got no response from BeauRoutine. So, I figured I would try to set up a new Tween using BeauRoutine for the whole setup, so I implemented the following:

Excerpt from new tween setup
    [ExecuteInEditMode]
    public class ArrowVisual : MonoBehaviour
    {
        public Tween beauTween;
        public Routine beauRoutine;

        public void PlayAnim()
        {
            var pos = transform.position;
            var currentHeight = new Vector3();
            beauTween = Tween.Vector(
                new Vector3(pos.x, 1.0f, pos.z),
                new Vector3(pos.x, 1.2f, pos.z),
                x => currentHeight = x,
                1f);
            beauTween.OnUpdate(x => transform.position = currentHeight);
            beauRoutine = beauTween.Play();
        }

        public void StopAnim()
        {
            beauRoutine.Stop();
        }
    }

Though now, using the "pure Beau" method, I seem to just get the following message in the console:

Exception message
[Exception] InvalidOperationException: The following game object is invoking the DontDestroyOnLoad method: Routine::Manager. Notice that DontDestroyOnLoad can only be used in play mode and, as such, cannot be part of an editor script.
Manager.Initialize() at /BeauRoutine/Routine/Internal/Manager.cs:309
307:   Host.Initialize(this);
308:   hostGO.hideFlags = HideFlags.HideInHierarchy | HideFlags.DontSaveInEditor;
-->309:   GameObject.DontDestroyOnLoad(hostGO);
311:   Log("Initialize() -- Version " + VERSION.ToString());

Is there any chance of me getting edit time tweening working with this package, or am I barking up the wrong tree, so to speak?

Thanks!
-MH

Can BeauRoutine Sequences, Combine works with DOTween

Hi!
I like this very much and using BeauToutine, I can construct code and logic much easier and clear.
For now, I have some old projects that heavy base on DOTween. So can I have something like adapter/bridge class or function to using DOTween with BeauRoutine?
I try some method like this

IEnumerator TweentoBeauRoutine(Tween tween)
	{	
		yield return tween.WaitForCompletion();
	}

And then using Yield or Then like this

var routine1 = BeauRoutine.Sequence.Create(transform.GetComponent<SpriteRenderer>().FadeTo(1f,1f)).Wait(1)
				.Then(transform.ScaleTo(0.65f,0.2f))
				.Then(transform.ScaleTo( 0.55f,0.1f))
				.Then(transform.ScaleTo(0.65f,0.05f))
				//.Yield(TweentoBeauRoutine(this.Scale(1f,2.0f)))
				.Then(() =>
				{
					print("OK here");
				})
			;

But DoTween is always executed before Routine.Start(this, routine);
Tween in BeauRoutine is awesome too but it takes time to convert all my DOTween functions to BeauRoutine so I am looking for way to wrapper it.
Thanks!

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.