예제 #1
0
    private void LoadFieldData()
    {
        string        path      = "Farm/Fields/farm_01/FieldData_01";
        FarmFieldData fieldData = AssetDataMng.Instance().LoadObject(path, null, true) as FarmFieldData;

        this.Field.SetFieldData(fieldData);
    }
예제 #2
0
    public EffectAnimatorObserver GetBuildCompleteEffect(Transform parentObject)
    {
        EffectAnimatorObserver effectAnimatorObserver = this.buildCompleteEffects.FirstOrDefault((EffectAnimatorObserver x) => x.IsStoped());

        if (null == effectAnimatorObserver)
        {
            GameObject gameObject = AssetDataMng.Instance().LoadObject("Cutscenes/NewFX3", null, true) as GameObject;
            if (null == gameObject)
            {
                global::Debug.LogError("NOT FOUND : Cutscenes/NewFX3");
            }
            else
            {
                effectAnimatorObserver = UnityEngine.Object.Instantiate <GameObject>(gameObject).GetComponent <EffectAnimatorObserver>();
                effectAnimatorObserver.transform.parent     = base.transform;
                effectAnimatorObserver.transform.localScale = Vector3.one;
                effectAnimatorObserver.transform.position   = parentObject.position;
                this.buildCompleteEffects.Add(effectAnimatorObserver);
                Resources.UnloadUnusedAssets();
            }
        }
        else
        {
            effectAnimatorObserver.transform.position = parentObject.position;
        }
        return(effectAnimatorObserver);
    }
예제 #3
0
    private void Awake()
    {
        FarmRoot.instance = this;
        string     path       = "Farm/Builds/SettingMark/SettingMark";
        GameObject gameObject = AssetDataMng.Instance().LoadObject(path, null, true) as GameObject;

        if (null == gameObject)
        {
            return;
        }
        GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(gameObject);

        gameObject2.transform.parent           = base.transform;
        gameObject2.transform.localScale       = Vector3.one;
        gameObject2.transform.localPosition    = Vector3.zero;
        gameObject2.transform.localEulerAngles = Vector3.zero;
        this.settingMark = gameObject2.GetComponent <FarmSettingMark>();
        path             = "Farm/Builds/SelectMark/SelectMark";
        gameObject       = (AssetDataMng.Instance().LoadObject(path, null, true) as GameObject);
        if (null == gameObject)
        {
            return;
        }
        gameObject2 = UnityEngine.Object.Instantiate <GameObject>(gameObject);
        gameObject2.transform.parent           = base.transform;
        gameObject2.transform.localScale       = Vector3.one;
        gameObject2.transform.localPosition    = Vector3.zero;
        gameObject2.transform.localEulerAngles = Vector3.zero;
        this.selectMark = gameObject2.GetComponent <FarmSelectMark>();
        gameObject2.SetActive(false);
        FarmCameraControlForCMD.ClearCount();
    }
예제 #4
0
        public override bool RunScriptCommand()
        {
            bool result = false;
            AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

            if (digimonInfo != null)
            {
                Transform child = digimonInfo.model.transform.GetChild(0);
                if (null != child)
                {
                    digimonInfo.animator = child.GetComponent <Animator>();
                    if (null == digimonInfo.animator)
                    {
                        digimonInfo.animator = child.gameObject.AddComponent <Animator>();
                    }
                    string path = "AdventureScene/Animation/Character/" + this.animatorFileName;
                    digimonInfo.animator.runtimeAnimatorController = (AssetDataMng.Instance().LoadObject(path, null, true) as RuntimeAnimatorController);
                    if (null != digimonInfo.animator.runtimeAnimatorController)
                    {
                        result = true;
                        base.ResumeScriptEngine();
                    }
                }
            }
            return(result);
        }
        public void LosdScriptEngine(string fileName, Action onFinish)
        {
            string            path              = "AdventureScene/Text/" + fileName;
            TextAsset         textAsset         = AssetDataMng.Instance().LoadObject(path, null, true) as TextAsset;
            FileControlHelper fileControlHelper = new FileControlHelper();

            AppCoroutine.Start(fileControlHelper.Decrypt(textAsset.bytes, new Action <byte[]>(this.OnLoadScriptFile)), onFinish, false);
        }
예제 #6
0
 private QuestEventInfoList GetEventInfo()
 {
     if (null == this.eventInfoList)
     {
         this.eventInfoList = (AssetDataMng.Instance().LoadObject("Quest/List/QuestEventInfoList", null, false) as QuestEventInfoList);
     }
     return(this.eventInfoList);
 }
예제 #7
0
 public static string GetBgPathForFTP(string path)
 {
     if (string.IsNullOrEmpty(path))
     {
         return(AssetDataMng.GetWebAssetImagePath() + "/login/");
     }
     return(AssetDataMng.GetWebAssetImagePath() + "/login/" + path);
 }
예제 #8
0
 protected virtual void Awake()
 {
     if (this.isInitialized)
     {
         return;
     }
     AssetDataMng.instance = this;
     this.isInitialized    = true;
 }
예제 #9
0
    private void PopFriendshipUpCount()
    {
        GameObject original   = AssetDataMng.Instance().LoadObject("UICommon/Farm/FriendshipUP", null, true) as GameObject;
        GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);

        gameObject.transform.parent = Singleton <GUIMain> .Instance.transform;
        gameObject.GetComponent <FriendshipUP>().farmObject = base.gameObject;
        gameObject.GetComponent <FriendshipUP>().ViewFriendshipStatus(this.digimonFriendShip.upFriendship);
    }
예제 #10
0
 private bool UpdateAssetBundle()
 {
     if (AssetDataMng.Instance().IsInitializedAssetBundle() && 0 < AssetDataMng.Instance().GetDownloadAssetBundleCount(string.Empty))
     {
         GUIMain.FadeWhiteReqScreen("UIAssetBundleDownLoad", null, 0.8f, 0.8f, true);
         return(true);
     }
     return(false);
 }
        public void Start()
        {
            GameObject original   = AssetDataMng.Instance().LoadObject("AdventureScene/AdventureSceneRoot", null, true) as GameObject;
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);

            gameObject.transform.parent   = null;
            gameObject.transform.position = Vector3.zero;
            this.adventureScene           = gameObject.GetComponent <AdventureSceneRoot>();
            UnityEngine.Object.DontDestroyOnLoad(gameObject);
        }
예제 #12
0
    private void LoadFacilityData()
    {
        string path = "Farm/Params/FacilityData";

        FarmDataManager.FacilityInfo = (AssetDataMng.Instance().LoadObject(path, null, true) as FarmFacilityData);
        path = "Farm/Animations/FacilityAnimationData";
        FarmDataManager.FacilityAnimationData = (AssetDataMng.Instance().LoadObject(path, null, true) as FarmFacilityAnimationData);
        path = "Farm/FacilityAnimation";
        FarmDataManager.FacilityAnimator = (AssetDataMng.Instance().LoadObject(path, null, true) as RuntimeAnimatorController);
    }
예제 #13
0
    public IEnumerator InitializeScript(string fileName)
    {
        ScriptEngine scriptEngine = new ScriptEngine();

        this.scriptEngine = scriptEngine;
        string            path              = "AdventureScene/Text/Guidance/" + fileName;
        TextAsset         textAsset         = AssetDataMng.Instance().LoadObject(path, null, true) as TextAsset;
        FileControlHelper fileControlHelper = new FileControlHelper();

        return(fileControlHelper.Decrypt(textAsset.bytes, new Action <byte[]>(this.OnLoadScriptFile)));
    }
    private void Start()
    {
        Vector3 localPosition = base.transform.localPosition;

        localPosition.y -= GUIMain.VerticalSpaceSize;
        base.transform.localPosition = localPosition;
        GameObject gameObject = AssetDataMng.Instance().LoadObject("UICommon/Farm/BuildCostLabel", null, true) as GameObject;

        if (null != gameObject)
        {
            this.buildCostLabelPosY = gameObject.transform.localPosition.y;
            GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(gameObject);
            this.buildCostLabel = gameObject2.GetComponent <BuildCostLabel>();
            this.buildCostLabel.gameObject.SetActive(false);
            Transform transform = gameObject2.transform;
            transform.parent        = base.transform;
            transform.localScale    = Vector3.one;
            transform.localPosition = Vector3.zero;
            transform.localRotation = Quaternion.identity;
        }
        GUICollider[] componentsInChildren = base.gameObject.GetComponentsInChildren <GUICollider>();
        if (componentsInChildren != null)
        {
            foreach (GUICollider guicollider in componentsInChildren)
            {
                if ("InfoButton" == guicollider.name)
                {
                    guicollider.onTouchEnded += this.OnPushedInfoButton;
                    this.infoButton           = guicollider;
                }
                if ("UpgradeButton" == guicollider.name)
                {
                    guicollider.onTouchEnded += this.OnPushedUpgradeButton;
                    this.upgradeButton        = guicollider;
                }
                if ("ShortCutButton" == guicollider.name)
                {
                    guicollider.onTouchEnded += this.OnPushedShortCutButton;
                    this.shortCutButton       = guicollider;
                }
                if ("SellButton" == guicollider.name)
                {
                    guicollider.onTouchEnded += this.OnPushedSellButton;
                    this.sellButton           = guicollider;
                }
                if ("StockButton" == guicollider.name)
                {
                    guicollider.onTouchEnded += this.OnPushedStockButton;
                    this.stockButton          = guicollider;
                }
            }
        }
        this.SettingButton();
    }
예제 #15
0
 private void SetupLocalize()
 {
     if (this.stampLabel != null)
     {
         this.stampLabel.text = StringMaster.GetString("BattleUI-37");
     }
     for (int i = 1; i <= this.stampTextureList.Length; i++)
     {
         this.stampTextureList[i - 1].mainTexture = (AssetDataMng.Instance().LoadObject("StampIcons/JP/" + this.stampNameList[i - 1], null, true) as Texture2D);
     }
 }
예제 #16
0
    public static FarmVisitFace Create()
    {
        string path = "UICommon/Farm/FarmVisit";

        UnityEngine.Object original   = AssetDataMng.Instance().LoadObject(path, null, true);
        GameObject         gameObject = UnityEngine.Object.Instantiate(original) as GameObject;

        gameObject.transform.SetParent(Singleton <GUIMain> .Instance.transform);
        gameObject.transform.localScale = Vector3.one;
        return(gameObject.GetComponent <FarmVisitFace>());
    }
예제 #17
0
    private UnityEngine.Object GetFromCache(string path)
    {
        string localizedPath = AssetDataMng.GetLocalizedPath(path);

        UnityEngine.Object @object = this._GetFromCache(localizedPath);
        if (!localizedPath.Equals(path) && @object == null)
        {
            @object = this._GetFromCache(path);
        }
        return(@object);
    }
예제 #18
0
    private UnityEngine.Object GetFromInternalResource(string path)
    {
        string localizedPath = AssetDataMng.GetLocalizedPath(path);

        UnityEngine.Object @object = Resources.Load(localizedPath);
        if (!localizedPath.Equals(path) && @object == null)
        {
            @object = Resources.Load(path);
        }
        return(@object);
    }
 public void SetTexture(string path)
 {
     AssetDataMng.Instance().LoadObjectASync(path, delegate(UnityEngine.Object obj)
     {
         if (obj != null)
         {
             Texture2D mainTexture        = obj as Texture2D;
             this.chipTexture.mainTexture = mainTexture;
         }
     });
 }
예제 #20
0
    private AssetDataMng.FindABInfoResult FindAssetBundleInfo(string path)
    {
        string localizedPath = AssetDataMng.GetLocalizedPath(path);

        AssetDataMng.FindABInfoResult findABInfoResult = this._FindAssetBundleInfo(localizedPath);
        if (!localizedPath.Equals(path) && findABInfoResult == null)
        {
            findABInfoResult = this._FindAssetBundleInfo(path);
        }
        return(findABInfoResult);
    }
    public void LoadEgg(string path, float posX = 0f, float posY = 4000f, float cPosY = 0f)
    {
        GameObject original = AssetDataMng.Instance().LoadObject(path, null, true) as GameObject;

        this.goChara      = UnityEngine.Object.Instantiate <GameObject>(original);
        this.goChara.name = path;
        this.goChara.transform.SetParent(base.gameObject.transform);
        Quaternion localRotation = Quaternion.Euler(0f, this.rotY, 0f);

        this.goChara.transform.localRotation    = localRotation;
        base.gameObject.transform.localPosition = new Vector3(posX, posY, 0f);
    }
예제 #22
0
    private IEnumerator StartDownload(int count)
    {
        AssetDataMng assetDataMng = AssetDataMng.Instance();

        if (!assetDataMng.IsAssetBundleDownloading())
        {
            assetDataMng.StartDownloadAssetBundle(count, 4);
        }
        yield return(base.StartCoroutine(this.UpdateProgressBar()));

        yield break;
    }
예제 #23
0
    private IEnumerator DownloadTex(string url)
    {
        Action <Texture2D> callback = delegate(Texture2D texture)
        {
            this.topTex = texture;
        };
        string downloadURL = AssetDataMng.GetWebAssetImagePath() + "/gasha/" + url;

        yield return(TextureManager.instance.Load(downloadURL, callback, this.TimeoutSeconds, true));

        yield break;
    }
예제 #24
0
    private IEnumerator Initialize(GameObject observer, string tutorialStatusId, Action completed)
    {
        bool idOk      = false;
        int  totalSize = 0;
        int  size      = 0;

        AssetDataMng.Instance().GetDownloadAssetBundleCount("TUTO1", out size);
        totalSize += size;
        AssetDataMng.Instance().GetDownloadAssetBundleCount("TUTO2", out size);
        totalSize += size;
        AssetDataMng.Instance().GetDownloadAssetBundleCount("TUTO3", out size);
        totalSize += size;
        AssetDataMng.Instance().GetDownloadAssetBundleCount("TUTO4", out size);
        totalSize += size;
        this.DownloadConfirmation(totalSize, delegate
        {
            idOk = true;
        }, false);
        RestrictionInput.EndLoad();
        while (!idOk)
        {
            yield return(null);
        }
        RestrictionInput.StartLoad(RestrictionInput.LoadType.LARGE_IMAGE_MASK_ON);
        DataMng.Instance().CampaignForceHide = true;
        this.gameEngineController = observer.AddComponent <TutorialControlToGame>();
        yield return(null);

        yield return(AppCoroutine.Start(base.LoadTutorialUI("Tutorial/TutorialUI"), false));

        yield return(AppCoroutine.Start(this.tutorialUI.LoadNonFrameText(), false));

        yield return(AppCoroutine.Start(this.tutorialUI.LoadSelectItem(), false));

        UIRoot root = GUIMain.GetUIRoot();

        if (null != root)
        {
            UIPanel component = root.GetComponent <UIPanel>();
            if (null != component)
            {
                component.depth = 100;
            }
        }
        yield return(AppCoroutine.Start(this.LoadScriptEngine(tutorialStatusId), false));

        if (completed != null)
        {
            completed();
        }
        yield break;
    }
예제 #25
0
 public IEnumerator AllBuild(GameWebAPI.RespDataMA_BannerM dts)
 {
     base.InitBuild();
     this.partsCount = 0;
     if (base.selectCollider != null)
     {
         GameWebAPI.RespDataMA_BannerM.BannerM[] menuBannerList = dts.bannerM.Where((GameWebAPI.RespDataMA_BannerM.BannerM x) => x.actionType == "menu" && ServerDateTime.Now >= DateTime.Parse(x.startTime) && GUIBannerParts.GetRestTimeSeconds(DateTime.Parse(x.endTime)) > 0).ToArray <GameWebAPI.RespDataMA_BannerM.BannerM>();
         this.partsCount = menuBannerList.Length;
         List <GameWebAPI.RespDataMA_BannerM.BannerM> dtList = new List <GameWebAPI.RespDataMA_BannerM.BannerM>();
         for (int mm = 0; mm < menuBannerList.Length; mm++)
         {
             dtList.Add(menuBannerList[mm]);
         }
         dtList.Sort(delegate(GameWebAPI.RespDataMA_BannerM.BannerM a, GameWebAPI.RespDataMA_BannerM.BannerM b)
         {
             int num  = int.Parse(a.dispNum);
             int num2 = int.Parse(b.dispNum);
             return(num - num2);
         });
         for (int mm = 0; mm < dtList.Count; mm++)
         {
             menuBannerList[mm] = dtList[mm];
         }
         GUISelectPanelBSPartsUD.PanelBuildData pbd = base.CalcBuildData(1, this.partsCount, 1f, 1f);
         float ypos = pbd.startY;
         float xpos = pbd.startX;
         for (int i = 0; i < menuBannerList.Length; i++)
         {
             GameWebAPI.RespDataMA_BannerM.BannerM bannerInfo = menuBannerList[i];
             GameObject go = base.AddBuildPart();
             if (!(null == go))
             {
                 GUIBannerParts parts = go.GetComponent <GUIBannerParts>();
                 if (parts != null)
                 {
                     parts.name += menuBannerList[i].dispNum.ToString();
                     parts.SetOriginalPos(new Vector3(xpos, ypos, -5f));
                     parts.Data = bannerInfo;
                     parts.SetBGColor();
                     string path = AssetDataMng.GetWebAssetImagePath() + bannerInfo.img;
                     yield return(TextureManager.instance.Load(path, new Action <Texture2D>(parts.OnBannerReceived), this.timeOutSeconds, true));
                 }
                 ypos -= pbd.pitchH;
             }
         }
         base.height       = pbd.lenH;
         base.initLocation = true;
         base.InitMinMaxLocation(-1, 0f);
     }
     base.selectParts.SetActive(false);
     yield break;
 }
    private IEnumerator DownloadBannerTexture(QuestData.WorldStageData wsd, Action <Texture2D> callback)
    {
        if (wsd.worldStageM.worldAreaId == ConstValue.QUEST_AREA_ID_DEFAULT || wsd.worldStageM.worldAreaId == "4" || wsd.worldStageM.worldAreaId == "5" || "null" == wsd.worldStageM.stageImage || string.IsNullOrEmpty(wsd.worldStageM.stageImage))
        {
            callback(null);
            yield break;
        }
        string path = AssetDataMng.GetWebAssetImagePath() + "/events/" + wsd.worldStageM.stageImage;

        yield return(TextureManager.instance.Load(path, callback, 30f, true));

        yield break;
    }
예제 #27
0
    private IEnumerator DownloadFontAsset()
    {
        bool result = AssetDataMng.Instance().AB_StartDownLoad("FONT", 4);

        if (result)
        {
            while (AssetDataMng.Instance().IsAssetBundleDownloading())
            {
                yield return(null);
            }
        }
        yield break;
    }
예제 #28
0
    private IEnumerator BuildBanner(GameWebAPI.RespDataMA_BannerM.BannerM banner)
    {
        GUIBannerParts parts = this.goScheduleBannerParts.GetComponent <GUIBannerParts>();

        if (parts != null)
        {
            parts.name += banner.dispNum.ToString();
            parts.Data  = banner;
            parts.SetBGColor();
            string path = AssetDataMng.GetWebAssetImagePath() + banner.img;
            yield return(TextureManager.instance.Load(path, new Action <Texture2D>(parts.OnBannerReceived), this.timeOutSeconds, true));
        }
        yield break;
    }
예제 #29
0
    private void SetConstructionModel(FarmObject farmObject)
    {
        string     constructionModelName = FarmUtility.GetConstructionModelName(farmObject);
        GameObject gameObject            = AssetDataMng.Instance().LoadObject(constructionModelName, null, true) as GameObject;

        if (null == gameObject)
        {
            global::Debug.LogError("工事中のモデルが見つからない : " + constructionModelName);
            return;
        }
        GameObject construction = UnityEngine.Object.Instantiate <GameObject>(gameObject);

        farmObject.SetConstruction(construction);
    }
예제 #30
0
        public static GameObject LoadMonsterModel(Transform parentTransform, string modelId)
        {
            GameObject gameObject  = null;
            string     filePath    = MonsterObject.GetFilePath(modelId);
            GameObject gameObject2 = AssetDataMng.Instance().LoadObject(filePath, null, true) as GameObject;

            if (null != gameObject2)
            {
                gameObject = UnityEngine.Object.Instantiate <GameObject>(gameObject2);
                Transform transform = gameObject.transform;
                transform.parent = parentTransform;
            }
            return(gameObject);
        }