// Note: If gameObject is not found at first call (in case scene is not fully loaded), this function is called multiple times public override void Init() { this.currentTurn = 1; spawners = GameObject.FindGameObjectsWithTag("Spawner"); if (spawners == null) { return; } if (spawners.Length == 0) { return; } // Instantiate initial pieces foreach (GameObject spawner in spawners) { string pieceName = Pieces.LotPieceName(); spawner.GetComponent <PieceSpawner>().Spawn(pieceName); } // prepare unityads UnityAdsManager.GetInstance(); // unlock pieces Pieces.Instance.UnLock(); // initialize flg this.isInitialized = true; SocialPlatformsManager.Instance.Init(); }
void Awake() { world = (World)FindObjectOfType(typeof(World)); adManager = (UnityAdsManager)FindObjectOfType(typeof(UnityAdsManager)); //연결된 다른 게임오브젝트에 world를 할당해준다. m_audioSource = GetComponent <AudioSource>(); }
// Start is called before the first frame update void Start() { Advertisement.AddListener(this); Advertisement.Initialize(GooglePlay_ID, TestMode); Instance = this; }
public void WatchJilejingtuAd() { Debug.Log("Watch QianbenyingAd"); Stop(); Waiting = Dances.JiLeJingTu; UnityAdsManager.Instance().UnityAdsShow(Values.PlacementId); }
public static UnityAdsManager Instance() { GameObject go = GameObject.FindGameObjectWithTag(Values.TagUnityAdsManager); UnityAdsManager uam = go.GetComponent <UnityAdsManager> (); return(uam); }
public void WatchQianbenyingAd() { Debug.Log("Watch QianbenyingAd"); Stop(); Waiting = Dances.QianBenYing; UnityAdsManager.Instance().UnityAdsShow(Values.PlacementId); }
void Start() { Instance = this; adManager = GameObject.FindGameObjectWithTag("Ad_Manager"); combinedAdManager = adManager.GetComponent <CombinedAdManager>(); unityAdManager = unityAdManager.GetComponent <UnityAdsManager>(); }
void Awake() { if (instance == null) { instance = this; } }
public static UnityAdsManager GetInstance() { if (null == instanse) { GameObject obj = new GameObject("UnityAdsManager"); instanse = obj.AddComponent <UnityAdsManager>(); } return(instanse); }
// Start is called before the first frame update void Start() { adManager = GameObject.FindGameObjectWithTag("Ad_Manager"); unityAdManager = adManager.GetComponent <UnityAdsManager>(); adMobManager = adManager.GetComponent <GoogleAdMobManager>(); combinedAdManager = adManager.GetComponent <CombinedAdManager>(); //combinedAdManager.showRandomBanner(); }
// Allows death animation to play IEnumerator LoadGameOverScreen() { yield return(new WaitForSeconds(2f)); UIScore.enabled = false; HelpMessage.enabled = false; HelpMessage_Outline.enabled = false; GameOverScreen.enabled = true; UnityAdsManager.IncrementDeathCountAndRunAd(); }
void Awake () { Instance = this; if (Advertisement.isSupported) { Advertisement.Initialize (id); } else { Debug.Log ("Platform not supported"); Log.log ("Platform not supported"); } }
bool isDebugMode = true; // should be false when shipped #endregion Fields #region Methods public static UnityAdsManager GetInstance() { if ( _instance == null ) { GameObject go = new GameObject("UnityAdsManager"); _instance = go.AddComponent<UnityAdsManager>(); _instance.Init(); } return _instance; }
public static UnityAdsManager GetInstance() { if (_instance == null) { GameObject go = new GameObject("UnityAdsManager"); _instance = go.AddComponent <UnityAdsManager>(); _instance.Init(); } return(_instance); }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
void Start() { musicManager = GameObject.FindObjectOfType <MusicManager>(); playAgainManager = GameObject.FindObjectOfType <PlayAgainManager>(); quitButtonManager = GameObject.FindObjectOfType <QuitButtonManager>(); audioSource = GetComponent <AudioSource>(); finalFinishImage = GameObject.FindObjectOfType <FinalFinishImage>(); finalFinishText = GameObject.FindObjectOfType <FinalFinishText>(); winSounds = GameObject.FindObjectOfType <WinSounds>(); directionalLight = GameObject.FindObjectOfType <DirectionalLight>(); unityAdsManager = GameObject.FindObjectOfType <UnityAdsManager>(); } //End
private void Awake() { DontDestroyOnLoad(this.gameObject); if (instance == null) { instance = this; } else { Destroy(this.gameObject); } }
// Start is called before the first frame update void Awake() { if (instance != null) { Destroy(gameObject); return; } instance = this; setUpAds(); DontDestroyOnLoad(gameObject); }
/// <summary>Callback when the AdButton on the ResultsCanvas is pressed.</summary> public void Results_AdButtonPressed() { resultsCanvas.SetInteractable(false); //display a video ad - if the player watches it, reward them UnityAdsManager.ShowRewardVideoWithCallback(() => { //play sfx AudioManager.instance.PlaySFX(AudioManagerKeys.doubleCoins); //double the player's score score *= 2; resultsCanvasScoreText.text = score.ToString(); //remove the ad button and center play again button resultsCanvasAdButton.SetActive(false); resultsCanvasPlayAgainButton.SetLocalX(0); resultsCanvas.SetInteractable(true); }); }
void Update() { if (!buttonEnabled) { counting += Time.deltaTime; if (counting >= interval) { counting = counting - interval; if (UnityAdsManager.Instance().UnityAdsIsReady(Values.PlacementId)) { OnAdsReady(); counting = 0f; } } } }
public void Restart() { int random = Random.Range(0, 2); if (random == 1) { UnityAdsManager unityAdsManager = FindObjectOfType <UnityAdsManager>(); unityAdsManager.ShowInterstitialAd(); } PlatformManager.instance.isPlatformSet = false; isGameRunning = false; player.GetComponent <Rigidbody>().velocity = Vector3.zero; player.transform.position = startPos.transform.position; GameManager.instance.StartGame(); carBody.SetActive(true); crash = false; }
public void Awake() { Mgrs.sceneMgr = this; if (string.IsNullOrEmpty(this.firstPanelPath)) { return; } if (this.pnlMgr == null) { return; } Mgrs.pnlMgr.Display(this.firstPanelPath); this.adsMgr = this.gameObject.AddComponent <UnityAdsManager> (); if (Mgrs.audioMgr != null) { audioMgr.PlayBGM(DEFINE_AUDIO.BGM_TYPE.NORMAL_01); } }
void Start() { pickupBoxManager = GameObject.FindObjectOfType <PickupBoxManager>(); unityAdsManager = GameObject.FindObjectOfType <UnityAdsManager>(); raceManager = GameObject.FindObjectOfType <RaceManager>(); if (user) { playerEngineSound = GameObject.FindObjectOfType <PlayerEngineSound>(); //Used to stop engine sound at race finish //Enable speed burst if user has gotten coins from watching video if (UnityAdsManager.PLAYER_COINS > 0) { //Enable speed burst, decrement coin count, set pickupbox image to speed burst pickupBoxType = PickupBoxManager.pickupBoxKind.SPEED; unityAdsManager.DecrementPlayerCoinCount(); pickupBoxManager.SetPickupBoxImage(2); //Set to speed image } else { pickupBoxType = PickupBoxManager.pickupBoxKind.EMPTY; pickupBoxManager.SetPickupBoxImage(3); //Set image to empty } } //The following is used when we cross the finish line, we can report what player we are if (this.CompareTag("Player1")) { iAmThisPlayer = 1; } else if (this.CompareTag("Player2")) { iAmThisPlayer = 2; } else if (this.CompareTag("Player3")) { iAmThisPlayer = 3; } else if (this.CompareTag("Player4")) { iAmThisPlayer = 4; } } //End
public override void Enter() { startState = false; adsMng = UnityAdsManager.instance; gm = context.GetGameManager(); spawnCtrl = gm.GetSpawnController(); uiMng = gm.GetUIManager(); shapeCtrl = gm.GetShapeController(); bgMng = gm.GetBackgroundManager(); printCtrl = gm.GetPrintController(); scoreCtrl = gm.GetScoreController(); musicCtrl = gm.GetMusicController(); PrintController.OnShapeGuessed += HandleOnShapeGuessed; PrintController.OnShapeWrong += HandleOnShapeWrong; ShapeController.OnShapeChanged += HandleOnShapeChange; ShapeController.OnNewShapeAdd += HandleOnNewShapeAdd; gm.OnGameEnd += HandleOnGameEnd; gameplayPanel = uiMng.GetMenu <UIMenu_Gameplay>(); printCtrl.EnableGraphic(false); uiMng.SetCurrentMenu <UIMenu_Gameplay>(0.5f, 0.5f, OnGameplayFadeIntCallback, OnGameplayFadeOutCallback); }
void InitAds() { Admob = new AdmobManager(); Unity = new UnityAdsManager(); if (Application.platform == RuntimePlatform.Android) { Admob.Init(Data.AndroidInfor.Admob); Unity.Init(Data.AndroidInfor.UnityVideoId); Debug.Log("API init android infors"); } else if (Application.platform == RuntimePlatform.IPhonePlayer) { Admob.Init(Data.IosInfor.Admob); Unity.Init(Data.IosInfor.UnityVideoId); Debug.Log("API init iOS infors"); } else { Admob.Init(Data.IosInfor.Admob); Unity.Init(Data.IosInfor.UnityVideoId); Debug.Log("API init other platform infors"); } }
// Start is called before the first frame update void Start() { //int randomNumber = Random.Range(1, 3); Instance = this; adManager = GameObject.FindGameObjectWithTag("Ad_Manager"); unityAdManager = adManager.GetComponent <UnityAdsManager>(); adMobManager = adManager.GetComponent <GoogleAdMobManager>(); combinedAdManager = adManager.GetComponent <CombinedAdManager>(); Debug.Log("HEYY"); int randomNumber = Random.Range(1, 3); Debug.Log("Random " + randomNumber); if (randomNumber == 1) { adMobManager.RequestBanner(); Debug.Log("showing ad mob"); } if (randomNumber == 2) { unityAdManager.PlayBannerAd(); Debug.Log("showing unity"); } }
public static string GetGameId(RuntimePlatform platform) { return(UnityAdsManager.GetGameId(platform)); }
public static void SetPlatformEnabled(RuntimePlatform platform, bool value) { UnityAdsManager.SetPlatformEnabled(platform, value); }
public static void SetGameId(RuntimePlatform platform, string gameId) { UnityAdsManager.SetGameId(platform, gameId); }
public static bool IsPlatformEnabled(RuntimePlatform platform) { return(UnityAdsManager.IsPlatformEnabled(platform)); }
void Start() { // GetInstance for initialization UnityAdsManager.GetInstance(); }
public void ShowAds() { UnityAdsManager unityAdsManager = UnityAdsManager.GetInstance(); unityAdsManager.ShowAds(null, RecoverPassCount); }