Exemplo n.º 1
0
 /// <summary>语言包加载完成</summary>
 private void OnComplete_LoadedLang()
 {
     TextManager.SetQueryString();
     ItemManager.Init();
     CommonConfig.Init();
     LotterRewardManager.Init();
     SuitConfig.Init();
     ClothesConfig.Init();
     ClothesSlevelConfig.Init();
     ClothesLevelConfig.Init();
     BabyLikingConfig.Init();
     UseEquipConfig.Init();
     ClothesInheritConfig.Init();
     ClothesMapConfig.Init();
     CloneLevelConfig.Init();
     LevelRewardConfig.Init();
     ArenaConfig.Init();
     SkillLevelConfig.Init();
     PropertySkillLevelConfig.Init();
     BossDailyConfig.Init();
     BossRewardConfig.Init();
     InstanceProxy.Get <PieceSwitchConfig>().LoadXml();
     InstanceProxy.Get <PlayerPositionConfig>().LoadXml();
     InstanceProxy.Get <MatchArrayConfig>().LoadXml();
     InstanceProxy.Get <PositionAttributeConfig>().LoadXml();
     InstanceProxy.Get <RandNameConfig>().LoadXml();
     InstanceProxy.Get <SkinConfig>().LoadXml();
     InstanceProxy.Get <MonsterConfig>().LoadXml();
     InstanceProxy.Get <CloneConfig>().LoadXml();
     InstanceProxy.Get <CameraConfig>().LoadXml();
     InstanceProxy.Get <MentalityMaxConfig>().LoadXml();
     InstanceProxy.Get <AbilityConfig>().LoadXml();
     InstanceProxy.Get <SkillConfig>().LoadXml();
     InstanceProxy.Get <SkillAIConfig>().LoadXml();
 }
Exemplo n.º 2
0
    public PaintBallPlayer(string bodyConfigId, ClothesConfig clothesConfig, string nickName /*, string photonUserID*/)
    {
        this.bodyConfigID  = bodyConfigId;
        this.clothesConfig = clothesConfig;
        this.nickName      = nickName;
/*        this.photonUserID = photonUserID;*/
    }
Exemplo n.º 3
0
    public Dictionary <string, ClothesConfig> pickedClothesConfigs = new Dictionary <string, ClothesConfig>(); //нужна тольк во время выполнения программы
                                                                                                               //для связи шмотки и айди активного варианта

    public void AddClothesConfig(string name, ClothesConfig clothesConf)
    {
        if (pickedClothesConfigs.ContainsKey(name))
        {
            pickedClothesConfigs.Remove(name);
        }
        pickedClothesConfigs.Add(name, clothesConf);
    }
Exemplo n.º 4
0
    public void InitializeSkins()
    {
        //getSex From savemanager
        currentConfig = LoadConf(_characterSex, _gameMode);

        //PUT ON CLOTHES FROM CONFIG
        PutOnClothes(currentConfig);
    }
Exemplo n.º 5
0
    private bool CheckIfItemIsActive(ItemConfig cfg)
    {
        ClothesConfig activeClothes = SaveManager.Instance.LoadClothesSet(characterGender.ToString() + currentMode.ToString());

        if (activeClothes.ItemIsInConfig(cfg))
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
Exemplo n.º 6
0
/*    private void Start()
 *  {
 *      PutOnClothes();
 *  }*/

    // puts on real model

    public void PutOnClothes()
    {
        if (photon == null || photon.IsMine || !PhotonNetwork.IsConnectedAndReady)
        {
            currentConfig = LoadConf(_characterSex, _gameMode);
            PutOnClothes(currentConfig);
        }
        else if (!photon.IsMine)
        {
            // Debug.Log("   Other         " + photon.Owner.UserId + " "+photon.Owner.CustomProperties["skin"].ToString());
            if (photon.Owner.CustomProperties["skin" + _gameMode.ToString()] != null)
            {
                PutOnClothes(photon.Owner.CustomProperties["skin" + _gameMode.ToString()].ToString());
            }
        }
    }
Exemplo n.º 7
0
    public void PutOnClothes(ClothesConfig config)
    {
        //PUT ON CLOTHES FROM CONFIG
        if (config != null)
        {
            foreach (string dirtyPair in config.pickedItemsAndVariants)
            {
                string[] strs = dirtyPair.Split('+');
                var      item = ScriptableList <ItemConfig> .instance.GetItemByID(strs[0]);

                if (item != null)
                {
                    PutOnItem(item, config.GetActiveVariant(item));
                }
            }
        }

        if (photon != null && photon.IsMine && photon.Owner != null)
        {
            ExitGames.Client.Photon.Hashtable customProperties = new ExitGames.Client.Photon.Hashtable();
            customProperties.Add("skin" + _gameMode.ToString(), JsonConvert.SerializeObject(config));
            photon.Owner.SetCustomProperties(customProperties);
        }
    }
Exemplo n.º 8
0
 public void SaveClothesSet(string key, ClothesConfig clothesConf)
 {
     changableDataConfig.AddClothesConfig(key, clothesConf);
     SaveChangableConfig();
 }
Exemplo n.º 9
0
    private void DisplayItem(GameObject itemGO)
    {
        currentClothesConfig = SaveManager.Instance.LoadClothesSet(previewManager.GetCurrentKey());
        variantSlider.SetActive(true); //activate it just in case


        //display item description
        itemCFG = itemGO.GetComponent <ItemDisplay>().itemConfig;
        rightPanel.SetActive(true);
        itemDisplaying = Instantiate(itemGO, rightPanel.transform.position, Quaternion.identity);
        itemDisplaying.transform.SetParent(parentForItem);
        itemDisplaying.GetComponent <RectTransform>().ResetTransform();
        itemDisplaying.GetComponent <RectTransform>().sizeDelta = itemDisplaySize;
        if (shopManager.CheckIfItemIsBought(itemCFG, currentClothesConfig.GetActiveVariant(itemCFG)))
        {
            buyButton.SetActive(false);
        }
        else
        {
            buyButton.SetActive(true);
        }


        //clear all variants
        var children = parentForVariants.GetComponentsInChildren <Transform>();

        foreach (Transform child in children)
        {
            if (child != parentForVariants.transform)
            {
                Destroy(child.gameObject);
            }
        }


        // spawn variants in RightSlider
        if (itemCFG.variants.Count > 1)
        {
            foreach (ItemVariant V in itemCFG.variants)
            {
                var varGroup = parentForVariants.GetComponent <VariantGroup>();
                var variant  = Instantiate(variantPrefab);
                variant.transform.SetParent(parentForVariants);
                var varTab = variant.GetComponent <VariantTab>();
                varTab.group   = varGroup;
                varTab.variant = V;
                varTab.group.Subscribe(varTab);
                varTab.tabBackground.color = V.color;
                bool hasActiveVar;
                if (currentClothesConfig.ItemIsInConfig(itemCFG))
                {
                    hasActiveVar = currentClothesConfig.GetActiveVariant(itemCFG) == V ? true : false;
/*                    Debug.Log("Item: " + itemCFG + ", active variant :" + currentClothesConfig.GetActiveVariant(itemCFG));*/
                }
                else
                {
                    hasActiveVar = V == itemCFG.variants[0] ? true : false;
                }
                varTab.activeIMG.gameObject.SetActive(hasActiveVar);

                bool isActive = currentClothesConfig.ItemAndVarIsInConfig(itemCFG, V) == true ? true : false;
                varTab.activeTick.SetActive(isActive);

                bool isBought = shopManager.CheckIfItemIsBought(itemCFG, V) /* || V.cost == 0*/ == true ? false : true;
                varTab.lockIMG.gameObject.SetActive(isBought);
            }
            ManipulateDisplayingInfo(currentClothesConfig.GetActiveVariant(itemCFG));
        }
        else
        {
            variantSlider.SetActive(false);
            ManipulateDisplayingInfo(itemCFG.variants[0]);
        }

        Destroy(itemDisplaying.GetComponent <ItemClick>());
    }
Exemplo n.º 10
0
    void LoadConf()
    {
        string key = GetCurrentKey();/*previewingCharSex.ToString() + previewingGameMode.ToString();*/

        previewingClothesConfig = SaveManager.Instance.LoadClothesSet(key);
    }
Exemplo n.º 11
0
/*    void OnBodyChanged(Transform transform)
 *  {
 *      skinHolder = transform;
 *  }*/

    private void OnGameModeChanged(GameMode gameMode)
    {
        _gameMode     = gameMode;
        currentConfig = LoadConf(_characterSex, _gameMode);
        PutOnClothes(currentConfig);
    }