Inheritance: Singleton
Ejemplo n.º 1
0
    void Start()
    {
        Instance = this;
        DontDestroyOnLoad(gameObject);

        Admob.Instance().initAdmob(bannerId, "");
    }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Manager = new AdManager();
                ApManager = new AdPositionManager();

                //ApManager.Save(new AdPositionInfo()
                //{
                //    Name = "首页大banner图",
                //    Width = 286,
                //    Height = 980,
                //    IsDeleted = 0,
                //    Sort = 0,
                //    State = 0
                //});

                ////添加
                //Manager.Save(new AdInfo()
                //{
                //    ApID = 1,
                //    Height = 980,
                //    Width = 286,
                //    Hits = 0,
                //    ImgUrl = "",
                //    Link = "",
                //    OffTime = DateTime.Now.AddDays(1),
                //    Title = "蜗居族正式上线运营",
                //    IsDeleted = 0,
                //    Sort = 0,
                //    State = 0
                //});
            }
        }
Ejemplo n.º 3
0
	// Use this for initialization
    void Start()
    {
        _user = GameObject.FindGameObjectWithTag("UserManager").GetComponent<UserManager>().CurrentUser;
        _view = this.GetComponent<CoherentUIView>();
        _view.OnViewCreated += new UnityViewListener.CoherentUI_OnViewCreated(this.OnViewReady);
        _view.Listener.ReadyForBindings += (frameId, path, isMainFrame) =>
        {
            _view.View.BindCall("ReadyForCategories", (System.Action)ReadyForCategories);
            _view.View.BindCall("GetBusinessSubCat", (System.Action<string>)GetBusinessSubCat);
            _view.View.BindCall("SetBusinessID", (System.Action<string>)SetBusinessID);
            _view.View.BindCall("LoadAdData", (System.Action)LoadAdData);
            _view.View.BindCall("SetBusinessIDForCard", (System.Action<string>)SetBusinessIDForCard);
            _view.View.BindCall("LoadBusinessCard", (System.Action)LoadBusinessCard);
            _view.View.BindCall("SetJsonString", (System.Action<string, int>)SetJsonString);
            _view.View.BindCall("SetFlashDealID", (System.Action<int>)SetFlashDealID);
            _view.View.BindCall("LoadFlashDeal", (System.Action)LoadFlashDeal);
            _view.View.BindCall("ClearFlashDeals", (System.Action)ClearFlashDeals);
            _view.View.BindCall("LoadFlashDeals", (System.Action)LoadFlashDeals);
            _view.View.BindCall("TrackUserAction", (System.Action<string, string, string>)TrackUserAction);
            _view.View.BindCall("OnAdPlayerWasClosed", (System.Action)OnAdPlayerWasClosed);
            _view.View.BindCall("FacebookLike", (System.Action<string>)FacebookLike);
			_view.View.BindCall("FacebookUnLike", (System.Action<string>)FacebookUnLike);
            _view.View.BindCall("CheckIfBusinessIsLiked", (System.Action)CheckIfBusinessIsLiked);
            _view.View.BindCall("SaveBusiness", (System.Action<string>)SaveBusiness);
            _view.View.BindCall("UnsaveBusiness", (System.Action<string>)UnsaveBusiness);
        };

        _adManager = GameObject.FindGameObjectWithTag("AdManager").GetComponent<AdManager>();
        _businessManager = GameObject.Find("BusinessManager").GetComponent<BusinessManager>();

    }
Ejemplo n.º 4
0
    void Awake()
    {
        if (current == null)
            current = this;
        else if (current != this)
            Destroy (gameObject);

        DontDestroyOnLoad (gameObject);
    }
Ejemplo n.º 5
0
    public string videoId;                              //This is the app id for interstitial ads

    private void Start()
    {
        Instance = this;                                //Here we have the a method which allows this object to never be destroyed
        DontDestroyOnLoad(gameObject);                  //even if the scene are changed

        Admob.Instance().initAdmob(bannerId, videoId);  //Initialzing BAnnerId and VideoId from the admob
        Admob.Instance().setTesting(true);              //THIS NEEDS TO BE COMMENTED WHEN BEING PUBLISHED. THIS IS FOR TESTING.
        Admob.Instance().loadInterstitial();            //Loads the interstitial video in the RAM
    }
Ejemplo n.º 6
0
    private void Start()
    {
        Instance = this;
        DontDestroyOnLoad(gameObject);
#if UNITY_EDITOR
#elif UNITY_ANDROID
        RequestInterstitial();
#endif
    }
Ejemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        Instance = this;
        DontDestroyOnLoad(gameObject);
#if UNITY_EDITOR
#elif UNITY_ANDROID
        Admob.Instance().initAdmob(bannerID, interstetialID);
#endif
    }
Ejemplo n.º 8
0
 // Start is called before the first frame update
 void Start()
 {
     myCameraManager         = gameObject.GetComponent <CameraManager>();
     myShopManager           = gameObject.GetComponent <ShopManager>();
     myAdManager             = gameObject.AddComponent <AdManager>();
     myAdManager.currentType = AdManager.AdvertisementType.Unity;
     myAdManager.DisplayBanner();
     DisableButton("Unity-Button");
 }
Ejemplo n.º 9
0
    private void Start()
    {
        Instance = this;
        DontDestroyOnLoad(gameObject);

        Admob.Instance().initAdmob(bunnerId, videoId);
        Admob.Instance().setTesting(CubePreloadre.testads);
        Admob.Instance().loadInterstitial();
    }
Ejemplo n.º 10
0
 private void SetPageObject()
 {
     if (_mgr == null)
     {
         _mgr = GetManager(AdsFileSource);
         _mgr.LoadAds(Convert.ToDateTime("01/01/2011"), Convert.ToDateTime("02/01/2011"));
         Pager.TotalRecords = GetCount();
     }
     SetPagerObject(Pager.TotalRecords);
 }
Ejemplo n.º 11
0
	private void Awake()
	{
		staticInstance = this;
		pooledAds = new List<Ad>[adPrefabs.Length];
		for(int i = 0; i < adPrefabs.Length; ++i)
		{
			pooledAds[i] = new List<Ad>();
		}
		//TryGenerateAd (new Vector3 (25,25, 0));
	}
Ejemplo n.º 12
0
    private static void InitializeOnLoad()
    {
        GameObject gameObject = new GameObject("AD Manager");

        Instance = gameObject.AddComponent <AdManager>();

        DontDestroyOnLoad(gameObject);

        SceneManager.sceneLoaded += OnSceneLoaded;
    }
Ejemplo n.º 13
0
 private void Awake()
 {
     instance = this;
     Advertisement.AddListener(this);
     Advertisement.Initialize(APP_ID, false);
     if (Advertisement.isInitialized)
     {
         Debug.Log("Ads initialized!");
     }
 }
 public void PlayButton()
 {
     button[0].SetActive(false);
     button[1].SetActive(false);
     button[1].GetComponentInChildren <Transform>().gameObject.SetActive(false);
     button[2].SetActive(true);
     button[3].SetActive(false);
     AdManager.Hide_Banner_Bot();
     Time.timeScale = 1f;
 }
Ejemplo n.º 15
0
 private void Start()
 {
     Instance = this;
     DontDestroyOnLoad(gameObject);
             #if UNITY_EDITOR
             #elif UNITY_ANDROID
     Admob.Instance().initAdmob(BANNER_ID, INTERSTITIAL_ID);
     Admob.Instance().loadInterstitial();
             #endif
 }
Ejemplo n.º 16
0
    public void GetMoreHints()
    {
        #if UNITY_EDITOR
        AddHints();
        #endif

        #if UNITY_ANDROID
        AdManager.GetInstance().DisplayRewardVideo();
        #endif
    }
Ejemplo n.º 17
0
 void Start()
 {
     sceneLoader = this.gameObject.GetComponent <SceneLoader>();
     adManager   = this.gameObject.GetComponent <AdManager>();
     resumeButton.onClick.AddListener(Resume);
     pauseButton.onClick.AddListener(Pause);
     restartButton.onClick.AddListener(Restart);
     mainMenuButton.onClick.AddListener(LoadMenu);
     potionForAdButton.onClick.AddListener(ShowRewardAdForFirePotion);
 }
Ejemplo n.º 18
0
	public void Start()
	{	
		Instance = this;
		DontDestroyOnLoad (gameObject);
		#if UNITY_EDITOR
		#elif UNITY_ANDROID
		Admob.Instance ().initAdmob ("ca-app-pub-7700781158729760/7249099599","ca-app-pub-7700781158729760/4978159471");
		Admob.Instance ().loadInterstitial ();	
		#endif
		}
Ejemplo n.º 19
0
    private void Start()
    {
        Instance = this;
        DontDestroyOnLoad(gameObject);

                #if UNITY_EDITOR
                #elif UNITY_ANDROID
        Admob.Instance().initAdmob(bannerId, videoId);
                #endif
    }
Ejemplo n.º 20
0
        // Successful purchase handler
        void OnPurchaseCompleted(IAPProduct product)
        {
            string name = product.Name;

            if (name.Equals(removeAds))
            {
                // Purchase of Remove Ads
                AdManager.RemoveAds();
            }
        }
Ejemplo n.º 21
0
    private void Start()
    {
        Instance = this;
        DontDestroyOnLoad(this.gameObject);

        Admob.Instance().initAdmob(bannerId, videoId);
        // Allow ads for testing mode - REMOVE WHEN PUBLISHING TODO
        Admob.Instance().setTesting(true);
        Admob.Instance().loadInterstitial();
    }
Ejemplo n.º 22
0
    /// <summary>
    /// Initializes the Tapdaq SDK.
    /// </summary>
    /// <param name="AutoLoadOverallCP">If set to <c>true</c> auto load Overall CP small.</param>
    /// <param name="_delegate">Delegate to notify client when ad is available.</param>
    public void InitTapdaq(AdAvailableDelegate _Delegate, TapdaqReadyDelegate _Ready)
    {
        Debug.Log("GT >> Initialize Tapdaq");
        TapdaqGAHelper.Log(TapdaqGAEvents.Initializing);

        NotifyAdAvailable = _Delegate;
        NotifyTapdaqReady = _Ready;

        AdManager.Init();
    }
Ejemplo n.º 23
0
 public void ShowVideo()
 {
     Debug.Log("GT >> ShowVideo: " + IsVideoAdLoaded);
     TapdaqGAHelper.Log(TapdaqGAEvents.ShowVideoAd);
     if (IsVideoAdLoaded)
     {
         AdManager.ShowVideo(videoTag);
     }
     IsVideoAdLoaded = false;
 }
Ejemplo n.º 24
0
        public volatile static int MaxClients       = 5760; // 60*60*24/15 = 4*60*24. 4 Links/min. 5760 Links/day.


        public static void Initialize()
        {
            Clients             = new ClientList();
            NetworkServerThread = null;
            NetworkServer       = null;
            DB     = new Database();
            Shield = new Shield();
            Shield.Load_Log();
            AdManager = new AdManager();
        }
        public AdStatusController(
            AdManager adManager,
            IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor)
        {
            this.adManager = adManager;

            var idOwner = GetOwner();

            this.adManager.SetOwner(idOwner);
        }
Ejemplo n.º 26
0
    private InterstitialAd interstitial;       //insert  your id
    private void Start()
    {
        Instance = this;
        DontDestroyOnLoad(gameObject);

                #if UNITY_EDITOR
//		print("Testing is on");
                #endif
        this.RequestInterstitial();
    }
Ejemplo n.º 27
0
    //private bool bannerHidden = true;
    void Awake()
    {
        // Make this a singleton
        if (instance == null)
            instance = this;
        else if (instance != this)
            Destroy (gameObject);

        DontDestroyOnLoad(gameObject);
    }
Ejemplo n.º 28
0
 void Awake()
 {
     if (Instance != null)
     {
         Destroy(gameObject);
         return;
     }
     DontDestroyOnLoad(gameObject);
     Instance = this;
 }
Ejemplo n.º 29
0
    private void GetAdServer()
    {
        GameObject myGameObject = GameObject.Find("AdManager");

        if (myGameObject == null)
        {
            CreateAdServer();
        }
        bannerWrapper = myGameObject.GetComponent <AdManager>();
    }
Ejemplo n.º 30
0
    void Start()
    {
        spriteRenderer = GetComponent <SpriteRenderer>();
        fizik          = GetComponent <Rigidbody2D>();
        oyunKontrol    = GameObject.FindGameObjectWithTag("karakterKontrol").GetComponent <OyunKontrol>();
        sesler         = GetComponents <AudioSource>();
        enYuksekPuan   = PlayerPrefs.GetInt("kayit");

        Ad = Object.FindObjectOfType <AdManager>();
    }
Ejemplo n.º 31
0
    private void Start()
    {
        //Advertisement.Initialize("1644012");
        //Advertisement.Initialize("1644013");

        instance = this;

        ipm = ItemPurchaseManager.instance;
        pl  = PreLoader.instance;
    }
Ejemplo n.º 32
0
 public void ShowInterstitial()
 {
     Debug.Log("GT >> ShowInterstitial: " + IsInterstitialAdLoaded);
     TapdaqGAHelper.Log(TapdaqGAEvents.ShowInterstitialAd);
     if (IsInterstitialAdLoaded)
     {
         AdManager.ShowInterstitial(interstitialTag);
     }
     IsInterstitialAdLoaded = false;
 }
Ejemplo n.º 33
0
        public void HasExpired_ShouldReturnTrue()
        {
            var mockWebHost = new Mock <IWebHostEnvironment>();
            var adManager   = new AdManager(mockWebHost.Object);
            var date        = new DateTime(2018, 1, 1);

            var result = adManager.HasExpired(date);

            result.Should().BeTrue();
        }
Ejemplo n.º 34
0
 IEnumerator BannerHide()
 {
     while (!game_over)
     {
         if (playing)
         {
             AdManager.HideBanner();
         }
         yield return(new WaitForSeconds(1.5f));
     }
 }
Ejemplo n.º 35
0
 public void PauseGame()
 {
     if (!game_over)
     {
         playing = false;
         paused_screen.SetActive(true);
         AdManager.ShowBanner();
         Time.timeScale = 0;
         is_paused      = true;
     }
 }
Ejemplo n.º 36
0
	void Start () {
		if (sInstance == null) {
			sInstance = this;
			DontDestroyOnLoad (gameObject);
		}
		string bannerMediaId;
		string bannerSpotId;
		string iconMediaId;
		string iconSpotId;
		string wallMediaId;
		string wallSpotId;
#if UNITY_IPHONE
			bannerMediaId = account.iOS.bannerMediaId;
			bannerSpotId = account.iOS.bannerSpotId;
			iconMediaId = account.iOS.iconMediaId;
			iconSpotId = account.iOS.iconSpotId;
			wallMediaId = account.iOS.wallMediaId;
			wallSpotId = account.iOS.wallSpotId;
#endif

#if UNITY_ANDROID

			bannerMediaId = account.android.bannerMediaId;
			bannerSpotId = account.android.bannerSpotId;
			iconMediaId = account.android.iconMediaId;
			iconSpotId = account.android.iconSpotId;
			wallMediaId = account.android.wallMediaId;
			wallSpotId = account.android.wallSpotId;
#endif

		//prepare banner
		IMobileSdkAdsUnityPlugin.registerInline (publisherId, bannerMediaId, bannerSpotId);
		IMobileSdkAdsUnityPlugin.start (bannerSpotId);
		mBannerViewId = IMobileSdkAdsUnityPlugin.show (bannerSpotId, IMobileSdkAdsUnityPlugin.AdType.BANNER, 
			                               IMobileSdkAdsUnityPlugin.AdAlignPosition.CENTER, 
			                               IMobileSdkAdsUnityPlugin.AdValignPosition.BOTTOM);

		//prepare icon
		IMobileSdkAdsUnityPlugin.registerInline (publisherId, iconMediaId, iconSpotId);
		IMobileSdkAdsUnityPlugin.start (iconSpotId);
		IMobileIconParams iconParams = new IMobileIconParams ();
		iconParams.iconNumber = 2;
		iconParams.iconTitleEnable = false;
		mIconViewId = IMobileSdkAdsUnityPlugin.show (iconSpotId, IMobileSdkAdsUnityPlugin.AdType.ICON, 0, 10, iconParams);

		//prepare wall
		IMobileSdkAdsUnityPlugin.registerFullScreen (publisherId, wallMediaId, wallSpotId);
		IMobileSdkAdsUnityPlugin.start (wallSpotId);

		HideBannerAd ();
		HideIconAd (); 
	}
Ejemplo n.º 37
0
 // Use this for initialization
 void Awake()
 {
     if(instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         DestroyImmediate(this);
     }
     Advertisement.Initialize("1018802");
 }
Ejemplo n.º 38
0
    void Awake()
    {
		narrator = GameObject.Find("Narrator");
        transform.parent = GameObject.Find("Anchor").transform;
        transform.localScale = new Vector3(1, 1, 1);
        if (Application.loadedLevel != 1)
        {
            transform.localPosition = new Vector3(0, -1386, -500);
            transform.localRotation = Quaternion.Euler(new Vector3(0, 0, 270));
        }
        adManager = GameObject.FindGameObjectWithTag("AdManager").GetComponent<AdManager>();
        SetUpDictionary();

        foreach (GameObject btn in pageBtns)
            btn.SetActive(true);
        detailsBtn.SetActive(true);
		Resources.UnloadUnusedAssets();

    }
Ejemplo n.º 39
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Manager = new AdManager();
                act = UrlHelper.GetString("act").ToLower();
                id = UrlHelper.GetString("id");

                switch (act)
                {
                    case "del":
                        Manager.Remove(id);
                        Response.Redirect(Request.Url.PathAndQuery);
                        break;
                    default:
                        break;
                }

                ViewBind();
            }
        }
Ejemplo n.º 40
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            //Create the ad manager
            adManager = new AdManager(this, "074b2c6e-51bf-4c69-aa42-35b4c5aa21e6");
            adManager.TestMode = false;
            Components.Add(adManager);

            // Frame rate is 30 fps by default for Windows Phone.
            TargetElapsedTime = TimeSpan.FromTicks(333333);
        }
Ejemplo n.º 41
0
    void Start()
    {
        if (instance == null)
        {
            instance = this;
            eventCounter = eventCounterStartingOffset;

            DontDestroyOnLoad(gameObject);

            adMobManager = gameObject.AddComponent<AdMobManager>();
            chartboostManager = gameObject.AddComponent<ChartboostManager>();

            chartboostManager.Initialize();

            adMobManager.RequestInterstitial();
            chartboostManager.RequestInterstitial();
            chartboostManager.RequestVideoAd();
        }
        else
        {
            Destroy(gameObject);
        }
    }
Ejemplo n.º 42
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            #if DEBUG
            bannerAd = adGameComponent.CreateAd("Image480_80", new Rectangle(0, 0, 480, 80), true);
            #else
            bannerAd = adGameComponent.CreateAd("81067", new Rectangle(0, 0, 480, 80), true);
            #endif
            bannerAd.ErrorOccurred += new EventHandler<Microsoft.Advertising.AdErrorEventArgs>(bannerAd_ErrorOccurred);
            bannerAd.AdRefreshed += new EventHandler(bannerAd_AdRefreshed);

            adDuplex = new AdManager(this, "8831");
            #if DEBUG
            adDuplex.IsTest = true;
            #endif
            adDuplex.LoadContent();

            backgroundTexture = Content.Load<Texture2D>("background");
            logoTexture = Content.Load<Texture2D>("logo");
            instructionsTexture1 = Content.Load<Texture2D>("Instructions1");
            instructionsTexture2 = Content.Load<Texture2D>("instructions2");

            pixelTexture = Content.Load<Texture2D>("pixel");

            spriteFont = Content.Load<SpriteFont>("SpriteFont");
            menuFont = Content.Load<SpriteFont>("MenuFont");

            tapScreen = new TextAnimation();
            string text = "Tap the screen to continue";
            Vector2 position = new Vector2(
                               (GraphicsDevice.Viewport.Width / 2) - (spriteFont.MeasureString(text).X / 2),
                               GraphicsDevice.Viewport.Height - (spriteFont.MeasureString(text).Y * 4)
                               );

            tapScreen.Initialize(spriteFont, text, position, Color.White);

            wallTexture = Content.Load<Texture2D>("wall");
            pathTexture = Content.Load<Texture2D>("path");
            solutionTexture = Content.Load<Texture2D>("solution");
            foodTexture = Content.Load<Texture2D>("food");
            swordTexture = Content.Load<Texture2D>("sword");
            prisonerTexture = Content.Load<Texture2D>("prisonerAnimation");

            startTexture = Content.Load<Texture2D>("startAnimation");

            treasureTexture = Content.Load<Texture2D>("treasureAnimation");

            playerAnimation = new Animation();
            playerTexture = Content.Load<Texture2D>("playerAnimation");
            playerAnimation.Initialize(playerTexture, Vector2.Zero, 48, 48, 2, 167, Color.White, 1f, true);

            fightAnimation = new Animation();
            fightTexture = Content.Load<Texture2D>("fightAnimation");
            fightAnimation.Initialize(fightTexture, Vector2.Zero, 48, 48, 6, 300, Color.White, 1f, true);

            winAnimation = new Animation();
            winTexture = Content.Load<Texture2D>("winAnimation");
            winAnimation.Initialize(winTexture, Vector2.Zero, 48, 48, 2, 300, Color.White, 1f, true);

            loseAnimation = new Animation();
            loseTexture = Content.Load<Texture2D>("loseAnimation");
            loseAnimation.Initialize(loseTexture, Vector2.Zero, 48, 48, 2, 300, Color.White, 1f, true);

            enemyTexture = Content.Load<Texture2D>("enemyAnimation");

            energyBarTexture = Content.Load<Texture2D>("energyBar");

            overlayTexture = Content.Load<Texture2D>("overlay");

            playerStep = Content.Load<SoundEffect>("sound/playerStep");
            enemyStep = Content.Load<SoundEffect>("sound/enemyStep");
            playerFight = Content.Load<SoundEffect>("sound/playerFight");
            swordDraw = Content.Load<SoundEffect>("sound/swordDraw");
            foodEating = Content.Load<SoundEffect>("sound/foodEat");
            pickupTreasure = Content.Load<SoundEffect>("sound/treasure");
            releasePrisoner = Content.Load<SoundEffect>("sound/prisoner");
        }
Ejemplo n.º 43
0
    private void Awake()
    {
        if (Instance != null && Instance != this)
        {
            Destroy(this.gameObject);
        }

        Instance = this;

        // Set initial count
        CurrentInterval = this.StartingCount;

        DontDestroyOnLoad(this.gameObject);
    }