void Start() { adsscript = Object.FindObjectOfType <AdsScript>(); sceneindex = SceneManager.GetActiveScene().buildIndex; StartCoroutine(ButtonRoutine()); }
void Awake() { if(instance) DestroyImmediate(gameObject); // delete duplicate else { instance = this; //Make this object the only instance DontDestroyOnLoad(gameObject); // dont destoy it when scenes load } }
public void CancelVideo() { wantToContinue.SetActive(false); ResetLevel(); if (Time.time - lastAdTime >= timeToPopAd) { lastAdTime = Time.time; AdsScript.ShowInterstitialAds(); } }
void Win() { Debug.Log("Won"); if (Time.time - lastAdTime >= timeToPopAd) { lastAdTime = Time.time; AdsScript.ShowInterstitialAds(); } levelFinished.SetActive(true); }
void Awake() { if (instance == null) { instance = this; Advertisement.Initialize(gameId); DontDestroyOnLoad(this); } else if (this != instance) { Destroy(gameObject); } }
// Use this for initialization void Start() { Screen.sleepTimeout = SleepTimeout.NeverSleep; ads = GameObject.FindGameObjectWithTag("Ads").GetComponent <AdsScript> (); audioSource = GameObject.FindGameObjectWithTag("BGMusic").GetComponent <AudioSource> (); IsTheGamePlayedForTheFirstTime(); CheckMusic(); GetAnimators(); AnimateButtonsSlideIn(); }
void PanelInit () { m_oCamera = this.transform.FindChild ("Camera").gameObject; MainData = new MainDataScript (); AdsData = new AdsScript (); AdsData.InitAds (); GameManager.Instance.InitPlayerData(); Dictionary<SceneState, string> dicTemp = new Dictionary<SceneState, string> (); dicTemp.Add (SceneState.Main, "PanelMain"); dicTemp.Add (SceneState.GameReady, "PanelReady"); for (SceneState eState = 0; eState < SceneState.Max; eState++) { DicScene.Add (eState, m_oCamera.transform.FindChild (dicTemp [eState]).GetComponent<PanelBaseScript> ()); DicScene [eState].SetManager (this, MainData); } SetScene(SceneState.Main); }
public void Start() { Instance = this; DontDestroyOnLoad(gameObject); #if UNITY_ANDROID string appId = "ca-app-pub-2631128054673594~6288751344"; #else string appId = "unexpected_platform"; #endif MobileAds.Initialize(appId); AdsScript.Instance.rewardBasedVideo = RewardBasedVideoAd.Instance; rewardBasedVideo.OnAdRewarded += HandleRewardBasedVideoRewarded; AdsScript.Instance.RequestRewardedVideo(); }
// Use this for initialization void Start() { endScoreBG.SetActive(false); endScoreTextPosition = endScoreText.rectTransform.localPosition; endCoinScorePosition = endCoinText.rectTransform.localPosition; endScoreText.rectTransform.localPosition = new Vector3(300, 300, 5); endCoinText.rectTransform.localPosition = new Vector3(300, 300, 5); isTheGameStartedFromBegining = true; animator = GetComponent <Animator> (); // getting the animator reference boundaries = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, 0, 0)); // getting player boundaries countTouches = 0; fadeScript = fader.GetComponent <GamePlayFadeScript> (); // fader script reference adScript = GameObject.FindGameObjectWithTag("Ads").GetComponent <AdsScript> (); cameraScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraScript> (); // camera script reference lastPosition = transform.position; // getting the players position easyDifficulty = GamePreferences.GetEasyDifficultyState(); mediumDifficulty = GamePreferences.GetMediumDifficultyState(); hardDifficulty = GamePreferences.GetHardDifficultyState(); // check if the game was started from main manu to set initial values IsTheGameStartedFromMainMenu(); // check if the game was resumed after player died to continue the game IsTheGameResumedAfterPlayerDied(); Time.timeScale = 0.0f; }
// Use this for initialization void Start() { Screen.orientation = ScreenOrientation.Portrait; this.Ads = GameObject.FindObjectOfType <AdsScript>(); this.Ads.ShowBanner(); }
void Awake() { createBoxScript = GetComponent<CreateBoxScript>(); uiScript = GameObject.Find("UI").GetComponent<UIScript>(); score = GameObject.Find("Score").GetComponent<Score>(); scrollingScript = GameObject.Find("2 - Middleground").GetComponent<ScrollingScript>(); adsScript = GetComponent<AdsScript>(); road = GameObject.Find("road"); road1 = GameObject.Find("road1"); }
private void Awake() { Instance = this; }
void Awake() { ins = this; }
void Start() { Instance = this; }
// Use this for initialization void Start() { this.m_ScoreManager = GameObject.FindObjectOfType <ScoreManager>(); this.ads = GameObject.FindObjectOfType <AdsScript>(); }
public void SetManager(MainManagerScript manager, MainDataScript data){ m_sManager = manager; MainData = data; AdsData = m_sManager.AdsData; }