Giter VIP home page Giter VIP logo

unity-ios-easy-native-alert's Introduction

IOS Easy Alert

Install

Add this as a package to your project by adding the below as an entry to the dependencies in the /Packages/manifest.json file:

"nrjwolf.games.iosnativealerts": "git+https://github.com/Nrjwolf/unity-ios-easy-native-alert"

For more information on adding git repositories as a package see the Git support on Package Manager in the Unity Documentation.


Example

using UnityEngine;

namespace Nrjwolf.Tools
{
    public class IOSNativeAlertsExample : MonoBehaviour
    {
        private void OnGUI()
        {
#if UNITY_IOS
            GUI.matrix = Matrix4x4.Scale(new Vector3(3.5f, 3.5f, 3.5f));
            if (GUILayout.Button("Simple Allert"))
            {
                IOSNativeAlert.ShowAlertMessage("Simple alert", "Press ok, if you're ok");
            }
            if (GUILayout.Button("Cancel/Ok"))
            {
                IOSNativeAlert.ShowAlertMessage(
                    "Check out my github",
                    "You can find another great plugins for unity on my github account",
                    new IOSNativeAlert.AlertButton("Cancel", null, ButtonStyle.Cancel),
                    new IOSNativeAlert.AlertButton("Github", () => Application.OpenURL("https://github.com/Nrjwolf"))
                    );
            }
            if (GUILayout.Button("Sheet"))
            {
                IOSNativeAlert.ShowSheetMessage(
                    "Do you want to reset your phone?",
                    "Just kidding, I can't do it :)",
                    new IOSNativeAlert.AlertButton("Cancel", null, ButtonStyle.Cancel),
                    new IOSNativeAlert.AlertButton("Let's do it", () => IOSNativeAlert.ShowToast("Reseting..."), ButtonStyle.Destructive)
                    );
            }
#endif
        }
    }
}


For Android check another my plugin https://github.com/Nrjwolf/unity-android-easy-native-alerts
Do not forgot to ⭐️ it.

I'm on reddit Мой телеграм канал

unity-ios-easy-native-alert's People

Contributors

nrjwolf avatar rfadeev avatar

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.