예제 #1
0
파일: GameScene.cs 프로젝트: 6epreu/PigGame
 // 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());
    }