示例#1
0
 // Method to show the BLAM message when hammer hits the ninja
 public static void showBlam(Vector2 pos)
 {
     blam.transform.position = pos;
     blam.GetComponent <SpriteRenderer>().enabled = true;
     hitSource.Play();
     StaticCoroutine.DoCoroutine(hideBlam());
 }
示例#2
0
 public sealed override void Create()
 {
     StaticCoroutine.DoCoroutine(CreateObject());
     if (Info.TextureUrl != null)
     {
         StaticCoroutine.DoCoroutine(GetWebTexture());
     }
     CreateCommentCanvas();
 }
示例#3
0
        /// <summary>
        /// Use in any MonoBehaviour
        /// </summary>
        public static void Setup()
        {
            _playerPrefs = new Dictionary <string, string>();
            DELAY_SAVE   = new WaitForSeconds(TIME_AUTO_SAVE);

            Load();

            if (AUTO_SAVE)
            {
                StaticCoroutine.DoCoroutine(AutoSave());
            }
        }
示例#4
0
        public void AddTweenToQueue(ITweenObject tweenObject)
        {
            _queue.Enqueue(tweenObject);
            TweenQueueIsEmpty = false;

            if (_tweenQueueRunning)
            {
                return;
            }

            _tweenQueueRunning = true;
            StaticCoroutine.DoCoroutine(RunTweenQueue());
        }
示例#5
0
        /// <summary>
        /// Coroutine to autosave
        /// </summary>
        /// <returns></returns>
        private static IEnumerator AutoSave()
        {
            Debug.Log("AutoSave");

            if (_needsSaving)
            {
                SaveData();
            }

            yield return(DELAY_SAVE);

            StaticCoroutine.DoCoroutine(AutoSave());
        }
 public static void playBGM(string filename, float volume = 1.0f, float pitch = 1.0f)
 {
     if (!listsCreated)
     {
         AudioController.createAudioList();
     }
     if (audioSourceBGM != null && audioSourceBGM.isPlaying)
     {
         return;
     }
     else
     {
         Destroy(audioSourceBGM);
         Destroy(tempObjectBGM);
     }
     if (volume < 0.0f)
     {
         Debug.Log("Volume must be greater than or equal to 0.0");
         volume = 1.0f;
     }
     else if (volume > 1.0f)
     {
         Debug.Log("Volume must be less than or equal to 1.0");
         volume = 1.0f;
     }
     //check for the exact filename (with specified extension)
     if (audioBGMFiles.Exists(x => x.Name == filename))
     {
         StaticCoroutine.DoCoroutine(AudioController.playAudio(filename, "bgm", volume, true, pitch));
     }
     //if the filename doesn't have an extension, check each extension
     else if (filename == System.IO.Path.GetFileNameWithoutExtension(filename))
     {
         foreach (string ext in extensionsAllowed)
         {
             //Remove function used to remove the * character needed in searching directories
             if (audioBGMFiles.Exists(x => x.Name == (filename + (ext.Remove(0, 1)))))
             {
                 StaticCoroutine.DoCoroutine(AudioController.playAudio(filename, "bgm", volume, true, pitch));
                 return;
             }
         }
         Debug.Log("Audio file " + filename + " not found.  Ensure the file exists, and is an accepted file typed.");
     }
     else
     {
         Debug.Log("Audio file " + filename + " not found.  Ensure you typed the correct extension");
     }
 }
示例#7
0
 public sealed override void Create()
 {
     StaticCoroutine.DoCoroutine(CreateObject());
 }
示例#8
0
 public void CreateCommentCanvas()
 {
     StaticCoroutine.DoCoroutine(CreateCommentCanvas(this.Info.AdNumber, this));
 }
示例#9
0
 public void LoadWordData()
 {
     StaticCoroutine.DoCoroutine(Respond());
 }
示例#10
0
 public static void GetListPlanets(Action successCallback = null, Action <string> errorCallback = null)
 {
     StaticCoroutine.DoCoroutine(PlanetsServices.GetList(successCallback, errorCallback));
 }
示例#11
0
 public static void Login(string login, string password, Action successCallback = null, Action <string> errorCallback = null)
 {
     StaticCoroutine.DoCoroutine(UsersServices.LoginWS(login, password, successCallback, errorCallback));
 }
示例#12
0
 public static void BuyItem(int ItemID, Action successCallback = null, Action <string> errorCallback = null)
 {
     StaticCoroutine.DoCoroutine(UsersServices.BuyItem(ItemID, successCallback, errorCallback));
 }
示例#13
0
 public static void LoadMarketById(int[] categoryArray, Action <float> updateCallback = null, Action successCallback = null, Action <string> errorCallback = null)
 {
     StaticCoroutine.DoCoroutine(CategoriesServices.LoadMarketById(categoryArray, updateCallback, successCallback, errorCallback));
 }
示例#14
0
    public static void send(string msg)
    {
        string query = "?data=" + msg;

        StaticCoroutine.DoCoroutine(GetToServer(query));
    }
示例#15
0
    public void Damage(int amount)
    {
        health -= amount;

        StaticCoroutine.DoCoroutine(GameMaster.flashScreenRed());
    }