Пример #1
0
    // 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();
    }
Пример #2
0
 void Awake()
 {
     world     = (World)FindObjectOfType(typeof(World));
     adManager = (UnityAdsManager)FindObjectOfType(typeof(UnityAdsManager));
     //연결된 다른 게임오브젝트에 world를 할당해준다.
     m_audioSource = GetComponent <AudioSource>();
 }
Пример #3
0
    // Start is called before the first frame update
    void Start()
    {
        Advertisement.AddListener(this);
        Advertisement.Initialize(GooglePlay_ID, TestMode);

        Instance = this;
    }
Пример #4
0
 public void WatchJilejingtuAd()
 {
     Debug.Log("Watch QianbenyingAd");
     Stop();
     Waiting = Dances.JiLeJingTu;
     UnityAdsManager.Instance().UnityAdsShow(Values.PlacementId);
 }
Пример #5
0
    public static UnityAdsManager Instance()
    {
        GameObject      go  = GameObject.FindGameObjectWithTag(Values.TagUnityAdsManager);
        UnityAdsManager uam = go.GetComponent <UnityAdsManager> ();

        return(uam);
    }
Пример #6
0
 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>();
 }
Пример #8
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Пример #9
0
 public static UnityAdsManager GetInstance()
 {
     if (null == instanse)
     {
         GameObject obj = new GameObject("UnityAdsManager");
         instanse = obj.AddComponent <UnityAdsManager>();
     }
     return(instanse);
 }
Пример #10
0
    // 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();
    }
Пример #11
0
    // 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();
    }
Пример #12
0
	void Awake ()
	{
		Instance = this;
		if (Advertisement.isSupported) {
			Advertisement.Initialize (id);
		} else {
			Debug.Log ("Platform not supported");
			Log.log ("Platform not supported");
		}

	}
Пример #13
0
    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;
    }
Пример #14
0
    public static UnityAdsManager GetInstance()
    {
        if (_instance == null)
        {
            GameObject go = new GameObject("UnityAdsManager");
            _instance = go.AddComponent <UnityAdsManager>();

            _instance.Init();
        }
        return(_instance);
    }
Пример #15
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Пример #16
0
 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
Пример #17
0
 private void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Пример #18
0
    // Start is called before the first frame update
    void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
            return;
        }

        instance = this;

        setUpAds();
        DontDestroyOnLoad(gameObject);
    }
Пример #19
0
 /// <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);
     });
 }
Пример #20
0
 void Update()
 {
     if (!buttonEnabled)
     {
         counting += Time.deltaTime;
         if (counting >= interval)
         {
             counting = counting - interval;
             if (UnityAdsManager.Instance().UnityAdsIsReady(Values.PlacementId))
             {
                 OnAdsReady();
                 counting = 0f;
             }
         }
     }
 }
Пример #21
0
    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;
    }
Пример #22
0
    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);
        }
    }
Пример #23
0
    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
Пример #24
0
    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);
    }
Пример #25
0
    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");
        }
    }
Пример #26
0
    // 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");
        }
    }
Пример #27
0
 public static string GetGameId(RuntimePlatform platform)
 {
     return(UnityAdsManager.GetGameId(platform));
 }
Пример #28
0
 public static void SetPlatformEnabled(RuntimePlatform platform, bool value)
 {
     UnityAdsManager.SetPlatformEnabled(platform, value);
 }
Пример #29
0
 public static void SetGameId(RuntimePlatform platform, string gameId)
 {
     UnityAdsManager.SetGameId(platform, gameId);
 }
Пример #30
0
 public static bool IsPlatformEnabled(RuntimePlatform platform)
 {
     return(UnityAdsManager.IsPlatformEnabled(platform));
 }
Пример #31
0
 void Start()
 {
     // GetInstance for initialization
     UnityAdsManager.GetInstance();
 }
Пример #32
0
    public void ShowAds()
    {
        UnityAdsManager unityAdsManager = UnityAdsManager.GetInstance();

        unityAdsManager.ShowAds(null, RecoverPassCount);
    }