Example #1
0
 // Use this for initialization
 void Start()
 {
     anim = GetComponent <Animator>();
     CalmBtn.onClick.AddListener(calm);
     Instance        = this;
     coinPerSecLevel = GameManager.Instance.stateData.CoinPerSecLevel;
     storageLevel    = GameManager.Instance.stateData.coinerStorageLevel;
     CPS             = calculatePerSec(coinPerSecLevel);
     storage         = CalculateStorage(storageLevel);
 }
Example #2
0
    public int CurrentAmount()
    {
        double a      = (DateTime.Now - stateData.GoldGet).TotalSeconds;
        int    amount = (int)(IdlePanel.calculatePerSec(stateData.CoinPerSecLevel) * a);

        if (amount > IdlePanel.CalculateStorage(stateData.coinerStorageLevel))
        {
            amount = IdlePanel.CalculateStorage(stateData.coinerStorageLevel);
        }
        return(amount);
    }
Example #3
0
    void notification()
    {
        NotificationManager.SendCustom(new NotificationParams
        {
            Id             = UnityEngine.Random.Range(0, int.MaxValue),
            Delay          = TimeSpan.FromSeconds(86400 * 7),
            Title          = Language("کجایی؟؟", "Where are you??"),
            Message        = Language("دلمون برات تنگ شده نمیخوایی به ما سر بزنی؟؟", "We miss you ,Dont you want to see us again?"),
            Ticker         = "Ticker",
            Sound          = true,
            Vibrate        = true,
            Light          = true,
            SmallIcon      = NotificationIcon.Heart,
            SmallIconColor = new Color(0, 0.5f, 0),
            LargeIcon      = "app_icon"
        });
        if (CurrentAmount() < IdlePanel.CalculateStorage(stateData.coinerStorageLevel))
        {
            int timeToGo = (int)((IdlePanel.CalculateStorage(stateData.coinerStorageLevel) - CurrentAmount()) / IdlePanel.calculatePerSec(stateData.CoinPerSecLevel));
            NotificationManager.SendCustom(new NotificationParams
            {
                Id             = UnityEngine.Random.Range(0, int.MaxValue),
                Delay          = TimeSpan.FromSeconds(timeToGo),
                Title          = Language("مخزن پر شده", "Storage is full "),
                Message        = Language("مخزن سکه هات پر شده زود بیا خالی کن تا دوباره پرش کنیم", "You storage is full quick make it empty so we can make coin again"),
                Ticker         = "Ticker",
                Sound          = true,
                Vibrate        = true,
                Light          = true,
                SmallIcon      = NotificationIcon.Clock,
                SmallIconColor = new Color(0, 0.5f, 0),
                LargeIcon      = "app_icon"
            });
        }

        /*if (currencyData.Meat > 1)
         * {
         *  NotificationManager.SendCustom(new NotificationParams
         *  {
         *      Id = UnityEngine.Random.Range(0, int.MaxValue),
         *      Delay = TimeSpan.FromSeconds(currencyData.Meat*3600),
         *      Title = Language("گوشتمون تموم شده", "We are out of meat"),
         *      Message = Language("گوشتمون تموم شده دیگه نمیتونیم کار کنیم", "We are out of meat we cant work anymore"),
         *      Ticker = "Ticker",
         *      Sound = true,
         *      Vibrate = true,
         *      Light = true,
         *      SmallIcon = NotificationIcon.Clock,
         *      SmallIconColor = new Color(0, 0.5f, 0),
         *      LargeIcon = "app_icon"
         *  });
         * }*/
        DateTime a = DateTime.Now;
        DateTime b = new DateTime(a.Year, a.Month, a.Day, 0, 0, 0);

        b = b.AddDays(1);
        double aa = (b - DateTime.Now).TotalSeconds;

        NotificationManager.SendCustom(new NotificationParams
        {
            Id             = UnityEngine.Random.Range(0, int.MaxValue),
            Delay          = TimeSpan.FromSeconds(aa),
            Title          = Language("جایزه و ماموریت جدید", "Prize & new Missions"),
            Message        = Language("زود باش بیا تو آرتانیا ", "Quick !! Come to Artania"),
            Ticker         = "Ticker",
            Sound          = true,
            Vibrate        = true,
            Light          = true,
            SmallIcon      = NotificationIcon.Event,
            SmallIconColor = new Color(0, 0.5f, 0),
            LargeIcon      = "app_icon"
        });
    }