public void setCurrentSpritesKit(int id) { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); if (!billing.isUnlock() /*!data.isBuy*/) { if (id == 1) { OnBuyClick(); } else { return; } } else { for (int i = 0; i < sets.Length; i++) { if (i == id) { sets[i].setBgColor(chooseColor, chooseColorText); sets[i].choose(); } else { sets[i].setBgColor(notChooseColor, notChooseColorText); sets[i].deSelect(); } } data.spritesId = id; data.save(); } }
void addPoints(int points) { int pre = 0; int after = 0; pre = currentScores / Config.pointsForTimer; currentScores += points; after = currentScores / Config.pointsForTimer; if (pre != after) { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_refresh_add); currentTimeBreakers++; showTimeBreakers(true); } currentScoresView.text = currentScores.ToString(); if (points > 0) { GameObject obj = Instantiate(flyingPointsPrefab, currentScoresView.gameObject.GetComponent <RectTransform> ().position, Quaternion.identity) as GameObject; obj.transform.SetParent(transform); obj.GetComponent <RectTransform> ().localScale = new Vector3(1f, 1f, 1f); obj.GetComponent <FlyingPoints> ().View(points, directionsForPoints[dirIndx]); dirIndx++; if (dirIndx >= directionsForPoints.Length) { dirIndx = 0; } } }
public void OnMainMenuClick() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); mainMenu.SetActive(true); options.SetActive(false); helpObj.SetActive(false); }
//TODO combine/put all this data in separate data structure public void AppRun(AssetDataAbstractBuilder parInitialAssetBuilder, IAssetDatabaseUpdateStrategy parInitialAssetDatabaseUpdateStrategy, SoundManagerColleague parViewSoundManagerColleague, ViewProviderColleague parViewSideViewProviderColleague) { if (CurrentAppState.CurrentBaseAppState != EBaseAppStates.Created) { throw new Exception("Already launched application model cannot be launched again!"); } CurrentAppState = new AppState() { CurrentBaseAppState = EBaseAppStates.Running }; //initialize resources manager AppResourceManager = new ResourceManager(AppInfoConsts.ResourcesAssetsDirpath, parInitialAssetBuilder, parInitialAssetDatabaseUpdateStrategy); // AppResourceManager.LoadAssetPack("packTest"); // AppResourceManager.LoadAssetPack("gfx_smd"); // Console.WriteLine($"{AppResourceManager.GetAssetData<AssetDataText>("packTest", "/data.txt").TextData[0]}"); //initialize sound manager ActualSoundManager = new AppSoundManager(AppResourceManager, this); ActualSoundManager.AppSoundManagerMediator.ViewSoundManagerColleague = parViewSoundManagerColleague; parViewSoundManagerColleague.Mediator = ActualSoundManager.AppSoundManagerMediator; ActualSoundManager.UpdateLibrary(); AppViewProviderMediator.ViewProviderViewSide = parViewSideViewProviderColleague; InitializeHumanPlayers(); /* * var testObj = AppGamePool.GetObject<GameObject>(typeof(GameObject)); * testObj.Init(this); * Console.WriteLine($"{testObj.LinkedAppModel}"); * testObj.DisableAndSendToPool(); * Console.WriteLine($"{testObj.LinkedAppModel}"); * Console.WriteLine($"{testObj.Test}"); */ GameObject launchingObject = AppGamePool.GetObject <GameObject>(typeof(GameObject)); launchingObject.Init(this); launchingObject.AddComponent <AppStartComponent>(AppGamePool .GetObject <AppStartComponent>(typeof(AppStartComponent)).Init(launchingObject)); //var testComp = AppGamePool.GetObject<TestInputExitComponent>(typeof(TestInputExitComponent)); //testComp.Init(testObj); //RegisterFixedUpdatableObject(new InputTestUpdatableObject(this)); //new InputTestUpdatableObject(this); //TODO: Application startup logic //TODO: Settings loading //TODO: App state machine definitions //TODO: Multithreading for physics }
public void showLeaderBoard() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); #if UNITY_IPHONE || UNITY_ANDROID UM_GameServiceManager.instance.ShowLeaderBoardsUI(); #else #endif }
public void OnOptionsClick() { options.GetComponent <Options> ().Initialize(); AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); mainMenu.SetActive(false); options.SetActive(true); helpObj.SetActive(false); }
public void OnRateClick() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); #if UNITY_IPHONE Application.OpenURL("https://itunes.apple.com/us/app/alien-the-hardest-game/id1049621532?ls=1&mt=8"); #else Application.OpenURL("https://play.google.com/store/apps/developer?id=Game+Star+Co.+Ltd"); #endif }
public static AppSoundManager Get() { if (_instance == null) { GameObject go = new GameObject("SoundManager"); go.transform.position = new Vector3(100, 100, 100); _instance = go.AddComponent <AppSoundManager>(); } return(_instance); }
public void runGame() { preGameView.SetActive(false); AppSoundManager.Get().PlayMusic(Music.Type.game); //Random.seed = seed; currentLvl = 0; currentScores = 0; currentTimeBreakers = 0; addPoints(0); restartGame(); }
public void onGamePress() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_click); loadScreen.SetActive(true); //GoTo.LoadMegaCity (); GoTo.LoadNewShop(); //StartCoroutine (showIntersential ()); AdMob_Manager.Instance.curTime = 0f; AdMob_Manager.Instance.hideBanner(); //GoTo.LoadEnvironmentChoose(); }
public void onPlayCLick(bool isTick = true) { if (isTick) { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); } AppSoundManager.Get().StopMusic(); GameObject.Find("AdvertsManager").GetComponent <AdvertsManager> ().HideBaner(); startGamePopup.SetActive(false); preGameView.SetActive(true); GetComponent <Animator> ().Play("PreGameAnim", 0, 0f); }
public void itemClick(Item itm) { if (!mStartedGameplay) { return; } if (itm.type == Item.Type.bad_spy) { Handheld.Vibrate(); AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_monster_click); loseGame(false, itm.gameObject); } else if (itm.type == Item.Type.good) { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_item_click); GameObject obj = Instantiate(flashPrefab, itm.gameObject.GetComponent <RectTransform>().position, Quaternion.identity) as GameObject; obj.transform.SetParent(transform); obj.GetComponent <RectTransform>().localScale = new Vector3(1f, 1f, 1f); if (preItemID == itm.goodTypeID) { streak++; if (streak >= 2) { showStreak(itm, streak); } } else { if (streak >= 2) { addPoints(calculatePointForStreak()); } streak = 1; } preItemID = itm.goodTypeID; itm.fadeOut(); foundItems += 1; if (foundItems >= itemsForFind) { if (streak >= 2) { addPoints(calculatePointForStreak()); streak = 1; } StartCoroutine(winGame()); } } }
void Awake() { if (_instance != null && _instance != this) { Debug.LogWarning("Destroy previous create sound manager"); GameObject.Destroy(_instance.gameObject); } _instance = this; createChannels(); pausedChannels = new List <AudioSource>(); isPaused = false; onFadeoutMusic = false; }
public void loseGame(bool isTime = false, GameObject obj = null) { if (!mStartedGameplay) { return; } AppSoundManager.Get().StopMusic(); if (data.highScore < currentScores) { data.highScore = currentScores; data.save(); UM_GameServiceManager.instance.SubmitScore(leaderBoardId, (int)currentScores); } if (currentScores > 5000) { UM_AdManager.instance.StartInterstitialAd(); } mStartedGameplay = false; if (isTime) { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_time_over); gameOverViewTime.SetActive(true); for (int i = 0; i < items.Count; i++) { if (items[i].GetComponent <Item>().type != Item.Type.good) { //objPool.push(items[i]); items[i].GetComponent <Item>().hideItem(); } } StartCoroutine(onGameOver()); } else { for (int i = 0; i < items.Count; i++) { if (items[i] != obj) { //objPool.push(items[i]); items[i].GetComponent <Item>().hideItem(); } } StartCoroutine(gameOverByClick()); } }
public void OnMusicTick() { data.music = !data.music; data.save(); AppSoundManager.MuteSfx = !data.music; AppSoundManager.MuteMusic = !data.music; AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); // if(data.music) // AppSoundManager.Get ().PlayMusic(Music.Type.game); // else // AppSoundManager.Get ().StopMusic (); setMusicImg(); }
public void loseGame(bool isTime = false, GameObject obj = null) { if (!mStartedGameplay) { return; } AppSoundManager.Get().StopMusic(); if (data.highScore < currentScores) { data.highScore = currentScores; data.save(); } mStartedGameplay = false; if (isTime) { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_time_over); gameOverViewTime.SetActive(true); for (int i = 0; i < items.Count; i++) { if (items[i].GetComponent <Item>().type != Item.Type.good) { //objPool.push(items[i]); items[i].GetComponent <Item>().hideItem(); } } StartCoroutine(onGameOver()); } else { for (int i = 0; i < items.Count; i++) { if (items[i] != obj) { //objPool.push(items[i]); items[i].GetComponent <Item>().hideItem(); } } StartCoroutine(gameOverByClick()); } PlayGamesPlatform.Instance.ReportScore(data.highScore, Config.borderId, (bool succes) => {}); }
public void onTimeClick() { if (currentTimeBreakers <= 0) { return; } AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_refresh_click); currentTimeBreakers -= 1; int count = items.Count; for (int i = 0; i < count; i++) { items[i].GetComponent <Item>().resetTime(); } showTimeBreakers(); timeBreakerAnimator.Play("useTimeBreakerPoints", 0, 0f); }
public void OnBtnPress() { state = !state; if (type == Type.MUSIC) { if (state) { Debug.Log("Music On"); setOnImg(); AppSoundManager.MuteMusic = false; GameData.Get().music = true; GameData.Get().save(); } else { setOffImg(); Debug.Log("Music OFF"); AppSoundManager.MuteMusic = true; GameData.Get().music = false; GameData.Get().save(); } } else { if (state) { setOnImg(); Debug.Log("SFX On"); AppSoundManager.MuteSfx = false; GameData.Get().sfx = true; GameData.Get().save(); } else { setOffImg(); Debug.Log("SFX OFF"); AppSoundManager.MuteSfx = true; GameData.Get().sfx = false; GameData.Get().save(); } } AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_click); }
public void showScreenBetweenLvl() { if (streakInGame < 7) { return; } betweenLvlvAnimator.gameObject.SetActive(true); AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_streak); if (streakInGame >= 7 && streakInGame < 9) { betweenLvlvAnimator.Play("good", 0, 0f); } else if (streakInGame >= 9 && streakInGame < 11) { betweenLvlvAnimator.Play("perfect", 0, 0f); } else if (streakInGame >= 11) { betweenLvlvAnimator.Play("exelent", 0, 0f); } }
public void setCurrentSpritesKit(int id) { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); data.spritesId = id; data.save(); }
public void OnRateClick() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); UniRate.Instance.PromptIfNetworkAvailable(); }
public void OnHighScoreClick() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); PlayGamesPlatform.Instance.ShowLeaderboardUI(Config.borderId); }
public void OnPlayClick() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); GameObject.Find("AdvertsManager").GetComponent <AdvertsManager> ().HideBaner(); GoTo.LoadGame(); }
public void OnExitClick() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); Application.Quit(); Debug.Log("exit"); }
public void switchCamera() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_click); var BikeScript = (BikeControl)target.GetComponent <BikeControl>(); camera.fieldOfView = Mathf.Clamp(BikeScript.speed / 10.0f + 60.0f, 60, 90.0f); if (BikeScript.curTorque == BikeScript.bikeSetting.shiftPower) { //transform.GetComponent<MotionBlur>().blurAmount = Mathf.Lerp(transform.GetComponent<MotionBlur>().blurAmount, 1.0f, Time.deltaTime * 5); } else { //transform.GetComponent<MotionBlur>().blurAmount = Mathf.Lerp(transform.GetComponent<MotionBlur>().blurAmount, 0.0f, Time.deltaTime); } Switch++; if (Switch > cameraSwitchView.Length) { Switch = 0; } if (Switch == 0) { if (BikeScript.currentGear == 0 && BikeScript.speed > 2) { backAngle = 180; } else { backAngle = 0; } float yAngle = Mathf.SmoothDampAngle(transform.eulerAngles.y, target.eulerAngles.y + backAngle, ref yVelocity, smooth); /* * float xAngle = Mathf.SmoothDampAngle(transform.eulerAngles.x, * target.eulerAngles.x + Angle, ref xVelocity, smooth); */ // Position at the target Vector3 position = target.position; // Then offset by distance behind the new angle position += Quaternion.Euler(0, yAngle, 0) * new Vector3(0, 0, -distance); // Apply the position // transform.position = position; // Look at the target transform.eulerAngles = new Vector3(Angle, yAngle, 0); var direction = transform.rotation * -Vector3.forward; var targetDistance = AdjustLineOfSight(target.position + new Vector3(0, haight, 0), direction); transform.position = target.position + new Vector3(0, haight, 0) + direction * targetDistance; } else { transform.position = cameraSwitchView[Switch - 1].position; transform.rotation = Quaternion.Lerp(transform.rotation, cameraSwitchView[Switch - 1].rotation, Time.deltaTime * 10.0f); } }
public static AppSoundManager Get() { if (_instance == null) { GameObject go = new GameObject("SoundManager"); go.transform.position = new Vector3(100,100,100); _instance = go.AddComponent<AppSoundManager>(); } return _instance; }
void Awake() { if (_instance != null && _instance != this) { Debug.LogWarning("Destroy previous create sound manager"); GameObject.Destroy(_instance.gameObject); } _instance = this; createChannels(); pausedChannels = new List<AudioSource>(); isPaused = false; onFadeoutMusic = false; }
public void OnBuyClick() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); billing.unlockKit(onBuy); }
public void onGamePress() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_click); loadScreen.SetActive(true); GoTo.LoadEnvironmentChoose(); }
public void onMenuClick() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); GoTo.LoadMenu(); }
public void onMenuClick() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); GameObject.Find("AdvertsManager").GetComponent <AdvertsManager> ().ShowBaner(); GoTo.LoadMenu(); }
public void OnBuyClick() { AppSoundManager.Get().PlaySfx(Sfx.Type.sfx_btn_click); }