Exemplo n.º 1
0
    void AssetLoadCallBack(GameObject ro, ParamData data)
    {
        /*NGUITools.SetChildLayer(ro.transform, LayerMask.NameToLayer("3D"));
         *      ro.transform.parent = mpos;
         *      ro.transform.localScale = new Vector3(400f,400f,400f);
         *      ro.transform.localPosition = Vector3.zero;
         *      ro.transform.localRotation = Quaternion.Euler (10f, 180f, 0f);
         */
        if (hasDestroy)
        {
            Destroy(ro);
            PlayerAsseMgr.DeleteAsset((ENTITY_ID)data.iParam, false);
            return;
        }
        if (gameObject == null || !this.gameObject.activeSelf)
        {
            return;
        }
        if (babyObj != null)
        {
            Destroy(ro);
            PlayerAsseMgr.DeleteAsset((ENTITY_ID)data.iParam, false);
            return;
        }
        ro.transform.parent        = mpos;
        ro.transform.localPosition = Vector3.forward * -200f;
        ro.transform.localScale    = new Vector3(400f, 400f, 400f);
        ro.transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
        //EffectLevel el =ro.AddComponent<EffectLevel>();
        //el.target =ro.transform.parent.parent.GetComponent<UISprite>();

        babyObj = ro;
    }
Exemplo n.º 2
0
 public void SDK_MomoryClean()
 {
     PlayerAsseMgr.ClearAll();
     EffectAssetMgr.ClearAll();
     Resources.UnloadUnusedAssets();
     Debug.Log("SDK_MomoryClean");
 }
Exemplo n.º 3
0
    public override void Destroyobj()
    {
        UIManager.RemoveButtonEventHandler(catchBtn_.gameObject, EnumButtonEvent.OnClick);
        UIManager.RemoveButtonEventHandler(closeBtn_.gameObject, EnumButtonEvent.OnClick);
        BabyData baby = BabyData.GetData(pdata.monsterID_);

        if (baby != null)
        {
            PlayerAsseMgr.DeleteAsset((ENTITY_ID)baby._AssetsID, false);
        }
    }
Exemplo n.º 4
0
 void OnDestroy()
 {
     hasDestroy = true;
     for (int n = 0; n < _icons.Count; n++)
     {
         HeadIconLoader.Instance.Delete(_icons[n]);
     }
     PlayerAsseMgr.DeleteAsset((ENTITY_ID)EmployeeData.GetData(curEmployee.GetIprop(PropertyType.PT_TableId)).asset_id, false);
     if (equipObj != null)
     {
         //AssetInfoMgr.Instance.DecRefCount(GlobalInstanceFunction.Instance.GetAssetsName((int)UIASSETS_ID.UIASSETS_EmployeeEquipPanel, AssetLoader.EAssetType.ASSET_UI), true);
     }
 }
Exemplo n.º 5
0
    public override void Destroyobj()
    {
        //AssetInfoMgr.Instance.DecRefCount(GlobalInstanceFunction.Instance.GetAssetsName((int)UIASSETS_ID.UIASSETS__Arena, AssetLoader.EAssetType.ASSET_UI), true);

        COM_EndlessStair[] rivals = ArenaSystem.Instance.Rivals;
        for (int i = 0; i < rivals.Length; i++)
        {
            PlayerAsseMgr.DeleteAsset((ENTITY_ID)rivals[i].assetId_, false);
        }

        for (int n = 0; n < _icons.Count; n++)
        {
            HeadIconLoader.Instance.Delete(_icons[n]);
        }

        GameObject.Destroy(gameObject);
    }
Exemplo n.º 6
0
 void OnDestroy()
 {
     hasDestroy                     = true;
     isHid                          = true;
     changeBabyNameOk               = null;
     BabyFightingStandby            = null;
     SetBabyListLockUIOk            = null;
     GamePlayer.Instance.OnShowBaby = null;
     RefreshBabyListOk             -= RefreshBabyListUI;
     MainbabyUI.OnoffmakeOk        -= NewBabyMakeOff;
     itemsList.Clear();
     GamePlayer.Instance.OnShowBaby = null;
     PlayerAsseMgr.DeleteAsset((ENTITY_ID)asssid, true);
     for (int n = 0; n < _icons.Count; n++)
     {
         HeadIconLoader.Instance.Delete(_icons[n]);
     }
 }
Exemplo n.º 7
0
 void AssetLoadCallBack(GameObject ro, ParamData data)
 {
     if (gameObject == null || !this.gameObject.activeSelf)
     {
         Destroy(ro);
         PlayerAsseMgr.DeleteAsset((ENTITY_ID)data.iParam, false);
         return;
     }
     if (babyObj != null)
     {
         Destroy(ro);
         PlayerAsseMgr.DeleteAsset((ENTITY_ID)data.iParam, false);
         return;
     }
     ro.transform.parent        = mpos;
     ro.transform.localScale    = new Vector3(250f, 250f, 250f);
     ro.transform.localPosition = Vector3.forward * -40;
     ro.transform.localRotation = Quaternion.Euler(10f, 180f, 0f);
     babyObj = ro;
 }
Exemplo n.º 8
0
    public void  GetActorClone(ENTITY_ID assetId, ENTITY_ID weaponId, EntityType type, CallBackPack.ActorLoadedCallBack callback, ParamData data = null, string layerName = "3D", int dressId = 0)
    {
        CallBackPack pack = new CallBackPack();

        pack.actorCallBack_ = callback;
        pack.data_          = data;
        ENTITY_ID AssId   = 0;
        ENTITY_ID WeassId = weaponId;

        if (dressId != 0)
        {
            AssId = (ENTITY_ID)dressId;
        }
        else
        {
            AssId = assetId;
        }
        pack.playerAssetId_ = AssId;
        pack.weaponAssetId_ = WeassId;
        pack.hasDress_      = dressId != 0;
        pack.layerName_     = layerName;
        pack.uid_           = GenerateUid;
        if (loadedPack_ == null)
        {
            loadedPack_ = new Dictionary <int, CallBackPack>();
        }

        loadedPack_.Add(pack.uid_, pack);

        bool ignoreWeaponUpdate = (type != EntityType.ET_Player);

        if (!ignoreWeaponUpdate)
        {
            pack.hasWeapon_ = weaponId != 0;
        }

        if (PlayerAsseMgr.LoadAsset(AssId, ActorAssetLoaded, new ParamData(pack.uid_, ignoreWeaponUpdate)) == false)
        {
            ClientLog.Instance.LogError("EntityAssetID: " + (int)AssId + " has not found!");
        }
    }
Exemplo n.º 9
0
    // Update is called once per frame
    void Update()
    {
        if (Application.platform == RuntimePlatform.Android && (Input.GetKeyDown(KeyCode.Escape)))
        {
            if (game.GameUser.getInstance().isFunctionSupported("exit"))
            {
                game.GameUser.getInstance().callFuncWithParam("exit");
            }
            else
            {
                MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("ConfirmQuit"), () =>
                {
                    Application.Quit();
                }, false, null, null, "", "", 2000, true);
            }
        }

        AtlasLoader.Instance.Update();
        PlayerDepLoader.Instance.Update();
        EffectDepLoader.Instance.Update();
        AssetInfoMgr.Instance.Update();
        UIAssetMgr.Update();
        PlayerAsseMgr.Update();
        EffectAssetMgr.Update();
        SceneLoader.Instance.Update();
        GuideManager.Instance.Update();
        GlobalInstanceFunction.Instance.Update();
        EventMgr.Instance.Update();
        NetConnection.Instance.Update();
        AssetLoader.Update();
        GameManager.Instance.Update();
        Prebattle.Instance.Update();
        Battle.Instance.Update();
        EffectMgr.Instance.Update();
        VersionManager.Instance.Update();
        ChatSystem.Update();
        BagSystem.instance.UpdateUsetime();
        BabyData.UpdateUsetime();
        EmployeeTaskSystem.instance.Update();
        if ((gameHandler._SdkInitSuccess || GlobalValue.IsDebugMode) && mayPullResFolderName)
        {
            mayPullResFolderName = false;
            //跳过cdn检查
            TransferRate._Inst.Send("Load LoginPanel Begin");
//            UIFactory.Instance.LoadUIPanel("LoginPanel", () =>
//            {
            UIFactory.Instance.OpenUI(GlobalValue.StageName_LoginScene, menuTypes.MAIN);
            TransferRate._Inst.Send("Load LoginPanel End");
//                AssetLoader.LoadAssetBundle("NpcNameLabel", AssetLoader.EAssetType.ASSET_UI, (AssetBundle bundle2, ParamData data2) =>
//                {
//                    nameLabel = bundle2.mainAsset;
//                    mayShowSysNotice = true;
//                }, null, Configure.assetsPathstreaming);
//            });
            //StartCoroutine(PullResFolderName());
        }

        if ((gameHandler._SdkInitSuccess || GlobalValue.IsDebugMode) && mayShowSysNotice)
        {
            TransferRate._Inst.Send("Show System Notice");
            mayShowSysNotice = false;
            //公告时 加载点轻量级资源
            PopText.Instance.Init();
            NpcHeadChat.Instance.Init();
            StartCoroutine(SysNotice());
        }
    }
Exemplo n.º 10
0
    // Update is called once per frame
    void Update()
    {
        if (Application.platform == RuntimePlatform.Android && (Input.GetKeyDown(KeyCode.Escape)))
        {
            MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("ConfirmQuit"), () =>
            {
                SDKInterface.Instance.SDKExit();
                //Application.Quit();
            }, false, null, null, "", "", 2000, true);
        }

        AtlasLoader.Instance.Update();
        PlayerDepLoader.Instance.Update();
        EffectDepLoader.Instance.Update();
        AssetInfoMgr.Instance.Update();
        UIAssetMgr.Update();
        PlayerAsseMgr.Update();
        EffectAssetMgr.Update();
        SceneLoader.Instance.Update();
        GuideManager.Instance.Update();
        GlobalInstanceFunction.Instance.Update();
        EventMgr.Instance.Update();
        NetConnection.Instance.Update();
        AssetLoader.Update();
        GameManager.Instance.Update();
        Prebattle.Instance.Update();
        Battle.Instance.Update();
        EffectMgr.Instance.Update();
        VersionManager.Instance.Update();
        ChatSystem.Update();
        BagSystem.instance.UpdateUsetime();
        BabyData.UpdateUsetime();
        EmployeeTaskSystem.instance.Update();

        if (mayShowSysNotice)
        {
            mayShowSysNotice = false;
            //公告时 加载点轻量级资源
            PopText.Instance.Init();
            NpcHeadChat.Instance.Init();
            StartCoroutine(SysNotice());
        }


        //PopText.Instance.Init();
        //NpcHeadChat.Instance.Init();
        //StartCoroutine(SysNotice());


        if (mayPullResFolderName)
        {
            mayPullResFolderName = false;
            //跳过cdn检查
            UIFactory.Instance.LoadUIPanel("LoginPanel", () =>
            {
                UIFactory.Instance.OpenUI(GlobalValue.StageName_LoginScene, menuTypes.MAIN);
                AssetLoader.LoadAssetBundle("NpcNameLabel", AssetLoader.EAssetType.ASSET_UI, (AssetBundle bundle2, ParamData data2) =>
                {
                    nameLabel        = bundle2.mainAsset;
                    mayShowSysNotice = true;
                }, null, Configure.assetsPathstreaming);
            });
            StartCoroutine(PullResFolderName());
            //
        }
    }
Exemplo n.º 11
0
 void DestroyBaby(ENTITY_ID eId, bool unLoadAllLoadedObjects, GameObject obj)
 {
     PlayerAsseMgr.DeleteAsset(eId, unLoadAllLoadedObjects);
     Destroy(obj);
 }
Exemplo n.º 12
0
    public static void LoadingAsyncScene(string name, SwitchScenEffect type = SwitchScenEffect.LoadingBar, bool withUI = true, bool withDynRes = false, bool manualClose = false, bool resetLocker = false)
    {
        if (GlobalValue.isBattleScene(name))
        {
            GamePlayer.Instance.isInBattle = true;
        }
        else
        {
            GamePlayer.Instance.isInBattle = false;
        }

        GameManager.Instance.EnableDelayCheck(false);
        GuideManager.Instance.ClearMask();
        GlobalInstanceFunction.Instance.ClearInvokeRepeat();

        PlayerAsseMgr.ClearAll();
        EffectAssetMgr.ClearAll();
        Resources.UnloadUnusedAssets();
        if (Loading || ScenePreloader.Instance.DiffSceneLoad(name))
        {
            wait4LoadQue_.Clear();
            WaitLoadInfo wli = new WaitLoadInfo();
            wli.name_        = name;
            wli.type_        = type;
            wli.withUI_      = withUI;
            wli.withDynRes_  = withDynRes;
            wli.manualClose_ = manualClose;
            wli.resetLocker_ = resetLocker;
            wait4LoadQue_.Enqueue(wli);
            return;
        }

        Loading = true;

        if (resetLocker)
        {
            GameManager.Instance.reconnectionLocker_ = false;
        }
        ApplicationEntry.Instance.switchSceneMask_.SetActive(true);

        if (OnSceneBeginLoad != null)
        {
            OnSceneBeginLoad();
        }

        UIManager.Instance.DoDeActive();
        withUI_      = withUI;
        withDynRes_  = withDynRes;
        manualClose_ = manualClose;
        preScene_    = Scene_name;
        Scene_name   = name;
        Loadtype     = type;

        if (Scene_name.Equals(GlobalValue.StageName_ReLoginScene))
        {
            GameManager.Instance.ClearCurrentState();
        }

        if (type == SwitchScenEffect.LoadingBar)
        {
            UIFactory.Instance.LoadUIPanel(UIASSETS_ID.UIASSETS_LoadingPanel, () => {
                UIFactory.Instance.CloseCurrentUI();
                UIFactory.Instance.OpenUI(UIASSETS_ID.UIASSETS_LoadingPanel, menuTypes.Popup);
                ApplicationEntry.Instance.switchSceneMask_.SetActive(false);
            });
        }
        else
        {
            GlobalInstanceFunction.LoadSceneUI(Scene_name, () => {
                ShowGame.Instance.ShowScenEffect(type);
            });
        }
        Prebattle.Instance.ClearAssetLoadCount();
        sendSceneLoaded_ = false;
    }
Exemplo n.º 13
0
 public override void Destroyobj()
 {
     PlayerAsseMgr.DeleteAsset((ENTITY_ID)Inst.properties_[(int)PropertyType.PT_AssetId], true);
 }