Forum rules - please read before posting.

How do I fire fade in or out from the script?

How do I fire fade in or out from the script?

cheers

Comments

  • AC.KickStarter.mainCamera.FadeIn (fadeTime);
    AC.KickStarter.mainCamera.FadeOut (fadeTime);
  • edited June 2015
    Correction, I need that for the sprites.


    AC.KickStarter.object.FadeIn (fadeTime); ?
  • Attach a SpriteFader script, and call it:

    mySpriteFader.Fade (FadeType.FadeIn, 0.2f);
    mySpriteFader.Fade (FadeType.FadeOut, 0.2f);
  • Cheers!
  • edited June 2015
    Just got back to check it. I can't get it work. It says:

     error CS1061: Type `UnityEngine.SpriteRenderer' does not contain a definition for `Fade' and no extension method `Fade' of type `UnityEngine.SpriteRenderer' could be found (are you missing a using directive or an assembly reference?)

    What am I missing?


    On a side note. This whole thing of calling a function from another script in Unity is ridiculous.
    In the previous engine I worked with it was simple. I could place it anywhere in the script, this.myfunction();
  • Tried to define it as public SpriteFader mySpriteFader;
    and calling like this:
    mySpriteFader.Fade (FadeType.FadeOut, 0.2f);

    Now it says:
     error CS0117: `AC.FadeType' does not contain a definition for `FadeOut'
  • Apologies - that's a lower case "f":

    FadeType.fadeOut
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.