// 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()); }
public sealed override void Create() { StaticCoroutine.DoCoroutine(CreateObject()); if (Info.TextureUrl != null) { StaticCoroutine.DoCoroutine(GetWebTexture()); } CreateCommentCanvas(); }
/// <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()); } }
public void AddTweenToQueue(ITweenObject tweenObject) { _queue.Enqueue(tweenObject); TweenQueueIsEmpty = false; if (_tweenQueueRunning) { return; } _tweenQueueRunning = true; StaticCoroutine.DoCoroutine(RunTweenQueue()); }
/// <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"); } }
public sealed override void Create() { StaticCoroutine.DoCoroutine(CreateObject()); }
public void CreateCommentCanvas() { StaticCoroutine.DoCoroutine(CreateCommentCanvas(this.Info.AdNumber, this)); }
public void LoadWordData() { StaticCoroutine.DoCoroutine(Respond()); }
public static void GetListPlanets(Action successCallback = null, Action <string> errorCallback = null) { StaticCoroutine.DoCoroutine(PlanetsServices.GetList(successCallback, errorCallback)); }
public static void Login(string login, string password, Action successCallback = null, Action <string> errorCallback = null) { StaticCoroutine.DoCoroutine(UsersServices.LoginWS(login, password, successCallback, errorCallback)); }
public static void BuyItem(int ItemID, Action successCallback = null, Action <string> errorCallback = null) { StaticCoroutine.DoCoroutine(UsersServices.BuyItem(ItemID, successCallback, errorCallback)); }
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)); }
public static void send(string msg) { string query = "?data=" + msg; StaticCoroutine.DoCoroutine(GetToServer(query)); }
public void Damage(int amount) { health -= amount; StaticCoroutine.DoCoroutine(GameMaster.flashScreenRed()); }