Coder Social home page Coder Social logo

unity_toastui's Introduction

Toast UI for your Game messages

A powerful,Customizable, and esay-to-use Toast UI for Unity

Toast ui



■ Supporting Platforms :

  • All platforms (Standalone Builds, Android, iOS, WebGl, and more..)

■ How to use? :

1- Import EasyUI_Toast.unitypackage package to your project.

⚠️ NOTE! : No need to add any prefab to the scene

3- Add EasyUI.Toast namespace in your script :

using EasyUI.Toast ;

4- Now Simply write Toast.Show():

// Simple :
Toast.Show ("Hello Devs") ;

// With duration :
Toast.Show ("Hello Devs", 3f) ;

■ Change colors :

// Built-in Colors  ( Black, Red, Purple, Magenta, Blue, Green, Yellow, Orange ) :
Toast.Show ("Hello Devs", 3f, ToastColor.Green) ;

// Custom Colors :
Toast.Show ("Hello Devs", 4f, new Color (1f, .4f, 0f)) ;
// or Toast.Show ("Hello Devs", 4f, Color.blue);

■ Change position :

// Positions ( TopLeft, TopCenter, TopRight, MiddleLeft, MiddleCenter, MiddleRight, BottomLeft, BottomCenter, BottomRight ) :
Toast.Show ("Top-Center Toast", 3f, ToastPosition.TopCenter) ;

■ Change text styling :

Toast.Show ("Hello, <color=yellow>This is a yellow text</color>", 3f);

Toast ui

for more supported style tags : Text supported styles



■ Dismiss (hide) toast :

Toast.Dismiss();

■ Other Show(..) versions :

Toast.Show (string text);

Toast.Show (string text, float duration);

Toast.Show (string text, float duration, ToastPosition position);

Toast.Show (string text, ToastColor color);

Toast.Show (string text, ToastColor color, ToastPosition position);

Toast.Show (string text, Color color);

Toast.Show (string text, Color color, ToastPosition position);

Toast.Show (string text, float duration, ToastColor color);

Toast.Show (string text, float duration, ToastColor color, ToastPosition position);

Toast.Show (string text, float duration, Color color);

Toast.Show (string text, float duration, Color color, ToastPosition position);





❤️ Donate

Paypal

unity_toastui's People

Contributors

herbou avatar reahaas 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

Watchers

 avatar  avatar  avatar  avatar

unity_toastui's Issues

ToastUI not working in 2020.3.1f1

I am getting an error when importing the ToastUI package:

You are trying to replace or create a Prefab from the instance 'text' that references a missing script. This is not allowed.
Please change the script or remove it from the GameObject.

Then, when I try to use the Toast, I get this error:

NullReferenceException: Object reference not set to an instance of an object
EasyUI.Toast.ToastUI.Show (System.String text, System.Single duration, UnityEngine.Color color) (at Assets/Toast UI/Scripts/ToastUI.cs:46)
EasyUI.Toast.ToastUI.Init (System.String text, System.Single duration, EasyUI.Toast.ToastColor color) (at Assets/Toast UI/Scripts/ToastUI.cs:38)
EasyUI.Toast.Toast.Show (System.String text, System.Single duration, EasyUI.Toast.ToastColor color) (at Assets/Toast UI/Scripts/Toast.cs:34)

Toast container position change

Is it possible to change the toast container position maually by setting up the transform position?

If yes, how can I change it?

DissToast.Dismiss() before toast load error: NullReferenceException

In my function "Pause game" I have a call to "Toast.Dismiss();". This raises an error because the object is not initialized yet.
To fix this, just add a call to "prepare" before dismissing.
Error:

NullReferenceException: Object reference not set to an instance of an object
EasyUI.Toast.Toast.Dismiss () (at Assets/MyPackages/Toast UI/Scripts/Toast.cs:113)
GameManagerScript.pauseGame () (at Assets/Scripts/GameManagerScript.cs:126)
GameManagerScript.Update () (at Assets/Scripts/GameManagerScript.cs:95)
image

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.