Coder Social home page Coder Social logo

Comments (5)

dentedpixel avatar dentedpixel commented on August 17, 2024

Oh thanks! I love it when the opened issue even contains exact instructions in how to fix it :)

I am glad you are enjoying LeanTween. I will include this in the next update.

from leantween.

LevelZed avatar LevelZed commented on August 17, 2024

And for those who want to change from any color (not only from white) also replace the code at Line 1250 between #else & #endif with:

                    SpriteRenderer renColor = trans.gameObject.GetComponent<SpriteRenderer>();
                    if(renColor!=null){
                        Color col = renColor.color;
                        this.setFromColor( col );
                    }else{
                        if(trans.gameObject.renderer!=null && trans.gameObject.renderer.material.HasProperty("_Color")){
                            Color col = trans.gameObject.renderer.material.color;
                            this.setFromColor( col );
                        }else if(trans.gameObject.renderer!=null && trans.gameObject.renderer.material.HasProperty("_TintColor")){
                            Color col = trans.gameObject.renderer.material.GetColor ("_TintColor");
                            this.setFromColor( col );
                        }else if(trans.childCount>0){
                            foreach (Transform child in trans) {
                                if(child.gameObject.renderer!=null){
                                    Color col = child.gameObject.renderer.material.color;
                                    this.setFromColor( col );
                                    break;
                                }
                            }
                        }
                    }

from leantween.

dentedpixel avatar dentedpixel commented on August 17, 2024

Great! Thank you LevelZed for the suggestion. I have added this code change in to the latest commit to github. Please let me know if there are any issues with it.

from leantween.

LevelZed avatar LevelZed commented on August 17, 2024

Hey bro, i've just upgraded to Unity 5 and updated your lib (2.27) from the AssetStore.
Looks like you forgot to add the eatcodeplay's comment (the 1st on this page) to LeanTween.cs line #2 194. But did not forget to add mine :)
So changing sprite color doesn't work or works weird in the 2.27 version (creates a material instance).

You rock, i love your lib!!! :)

from leantween.

dentedpixel avatar dentedpixel commented on August 17, 2024

Woops! Thanks for the heads up LevelZed. I think I got it right this time. If you want to take a look at the latest commit, I have attempted to make the color tweening on a sprite not act wonky.

Thanks for your support :), I am glad it has been working well for you!

from leantween.

Related Issues (20)

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.