예제 #1
0
    public void Init()
    {
        allTips = JsonFile.ReadFromFile <JsonList <Tips> >("Text/", "tipsInfo").ToList();

        Mediator.AddValue(this, "ownTips", "nowTips", "ownNowTips");
        Mediator.AddListener(this, "getTips", "onLoadOwnTipsId", "getAllTips", "getThisLevelTips");
    }
예제 #2
0
    public void Init()
    {
        productList = JsonFile.ReadFromFile <JsonList <Product> >("Text/", "productInfo").ToList();
        timer       = new Timer(60f, false, timerText, TimeOut);//看完之后必须等60秒才能看第二个

        Mediator.AddListener(this, "onProcessPurchased", "startWatchAdTimer", "updateWatchAdTimer", "onLoadOwnProductId");
        Mediator.AddValue(this, "productList", "removeAd", "watchAdTimeOut");
    }
예제 #3
0
 public void Init()
 {
     GetPhysicalAddress();
     manager = new MySqlManager("23.105.221.177", "feedback", "feedback", "1344710445");
     manager.onSqlConnected += OnSqlConnected;
     manager.OpenSqlConnection();
     Mediator.AddListener(this, "feedback");
     Mediator.AddValue(this, "reply");
 }
예제 #4
0
    private void Awake()
    {
        foreach (Transform child in transform)
        {
            overallDic.Add(int.Parse(child.name.Split('_')[0]), child.gameObject);
        }

        Mediator.AddListener(this, "openOverall");
        Mediator.AddValue(this, "nowOverall");
    }
예제 #5
0
    private void Awake()
    {
        foreach (Transform child in transform)
        {
            partDic.Add(int.Parse(child.name.Split('_')[0]), child.gameObject);
        }

        Mediator.AddListener(this, "openPart", "closePart");
        Mediator.AddValue(this, "nowPart");
    }
예제 #6
0
    private void Awake()
    {
        foreach (Transform child in transform)
        {
            mixDic.Add(int.Parse(child.name.Split('_')[0]), child);
        }

        Mediator.AddListener(this, "setActiveProps", "closeMakeUp");
        Mediator.AddValue(this, "mixProp");
    }
예제 #7
0
    public void Init()
    {
        GameSetting setting = JsonFile.ReadFromFile <GameSetting>("Text/", "gameSetting");

        gameId = setting.gameId;
#if UNITY_IOS
        developerId = setting.iosDeveloperId;
        appId       = setting.iosAppId;
#elif UNITY_ANDROID
        developerId = setting.androidDeveloperId;
        appId       = setting.androidAppId;
#endif

        MonoManager.mono.StartCoroutine(ConnectionMySql());

        Mediator.AddListener(this, "openLikeUrl", "openMoreGameUrl", "startOpenLikeUrl");
        Mediator.AddValue(this, "showInters", "shareUrl", "shareImageUrl");
    }
예제 #8
0
    public void Init()
    {
        var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());

        foreach (var product in Mediator.GetValue("productList") as List <Product> )
        {
            if (product.type == ProductType.Coin)
            {
                builder.AddProduct(product.id, UnityEngine.Purchasing.ProductType.Consumable);
            }
            else
            {
                builder.AddProduct(product.id, UnityEngine.Purchasing.ProductType.NonConsumable);
            }
        }
        UnityPurchasing.Initialize(this, builder);
        Mediator.AddListener(this, "buyProduct", "restore");
        Mediator.AddValue(this, "coin1Price", "coin2Price");
    }
예제 #9
0
    public void Init()
    {
        GameSetting setting = JsonFile.ReadFromFile <GameSetting>("Text/", "gameSetting");

        if (setting.deleteData == true)
        {
            DeleteData();
        }
        Mediator.AddListener(this,
                             "onAddGem",
                             "addCoin",
                             "onUnlockLevelUpdate",
                             "onReviewed",
                             "showRewardAd",
                             "onOwnTipsUpdate",
                             "deleteData",
                             "onOwnProductUpdate",
                             "updateOwnProps"
                             );
        Mediator.AddValue(this, "coin", "reviewed", "rewardGem", "rewardNumber");
    }
예제 #10
0
    public void Init()
    {
        audioList = new List <AudioClip>(Resources.LoadAll <AudioClip>("Audio/"));
        if (GameObject.Find("[BgAudioSource]") == null)
        {
            var obj = new GameObject("[BgAudioSource]");
            Object.DontDestroyOnLoad(obj);
            bgAudioSource = obj.AddComponent <AudioSource>();
        }
        if (GameObject.Find("[ActionAudioSource]") == null)
        {
            var obj = new GameObject("[ActionAudioSource]");
            Object.DontDestroyOnLoad(obj);
            actionAudioSource = obj.AddComponent <AudioSource>();
        }
        InitAudioSource();
        //PlayBgAudio();

        Mediator.AddListener(this, "playAudio", "soundOn", "soundOff", "playBgAudio");
        Mediator.AddValue(this, "soundOn");
    }
예제 #11
0
    public void Init()
    {
        GameSetting setting = JsonFile.ReadFromFile <GameSetting>("Text/", "gameSetting");

#if UNITY_IOS
        admobGeneralBannerUnitId = setting.admobIosGeneralBannerUnitId;
        admobCubeBannerUnitId    = setting.admobIosCubeBannerUnitId;
        admobIntersUnitId        = setting.admobIosIntersUnitId;
        admobRewardUnitId        = setting.admobIosRewardUnitId;
        unityAdsGameId           = setting.unityIosAdsGameId;
        unityPlacementId         = setting.unityIosPlacementId;
#endif
        InitAD();
        LocalAdManager.GetInstance().Init();
        Mediator.AddListener(this, "onRemoveAd", "showRewardAd", "showTopBanner", "hideBanner", "showIntersAd", "showTimerIntersAd", "showCubeBanner", "onLoadedLevel");
        Mediator.AddValue(this, "rewardAdIsReady");

        intersTimer = new Timer(120, false, () =>
        {
            showTimerInters = true;
        });//隔120s显示插屏
        intersTimer.Start();
    }
예제 #12
0
 public void Init()
 {
     CoroutineManager.StartCoroutine(ConnectionMySql());
     Mediator.AddValue(this, "moreGameInfo");
 }
예제 #13
0
 public void Init()
 {
     dataList = JsonFile.ReadFromFile <JsonList <LocalBannerData> >("Text/", "localBannerInfo").ToList();
     Mediator.AddValue(this, "bannerData", "cubeBannerData");
 }
예제 #14
0
 public void Init()
 {
     allProps = JsonFile.ReadFromFile <JsonList <Props> >("Text/", "propsInfo").ToList();
     Mediator.AddListener(this, "getProps", "setActiveProps", "useProps", "onLoadedLevel", "deleteProps", "onLoadOwnPropsId");
     Mediator.AddValue(this, "activeProps");
 }
예제 #15
0
 private void Awake()
 {
     allLevel = JsonFile.ReadFromFile <JsonList <Level> >("Text/", "levelInfo").ToList();
     Mediator.AddListener(this, "loadLevel", "passLevel", "onLoadUnlockLevelId", "unlockAllLevel");
     Mediator.AddValue(this, "nowLevel", "allLevel", "unlockLevel");
 }