コード例 #1
0
    IEnumerator _LoadFromBundle(int _costumeID, bool _isMine)
    {
        Logger.E("costumeID: " + _costumeID);
        AssetBundle  ab      = AssetBundle.LoadFromFile(BundleManager.instance.GetItemLoadPath(DownloadType.ASSET, 6, _costumeID));
        GameObject   objHero = (GameObject)ab.LoadAsset(_costumeID + "_1", typeof(GameObject));
        _SpineObject hero    = objHero.GetComponent <_SpineObject> ();

        if (hero)
        {
            Logger.E("hero not null");
            spineHero = Instantiate(hero, this.transform);
            if (_isMine)
            {
                SetMyPartBack();
            }
            yield return(_WFSUtility.wef);

            spineHero.transform.localEulerAngles = Vector3.zero;
            //if (_costumeID == 3)
            //{
            //    spineHero.transform.localScale = scaleLuBu;
            //    spineHero.transform.localPosition = posLuBu;
            //}
            //else if (_costumeID == 7)
            //{
            spineHero.transform.localScale    = Vector3.one;
            spineHero.transform.localPosition = posLuBu;
            //}
            spineHero.StartRandomMove();
        }
        ab.Unload(false);
    }
コード例 #2
0
    IEnumerator _LoadFromBundle(int _costumeID)
    {
        _SpineObject hero = BundleManager.instance.LoadFromBundle(_costumeID);

        if (hero)
        {
            Reset();
            yield return(_WFSUtility.wef);

            spineHero = Instantiate(hero, this.transform);
            yield return(_WFSUtility.wef);

            spineHero.transform.localEulerAngles = Vector3.zero;
            spineHero.transform.localPosition    = Vector3.one;
            //if (_costumeID == 10)
            //    spineHero.transform.localScale = scaleLubu;
            //else
            //spineHero.transform.localScale = Vector3.one;
            spineHero.StartStandRandomMove();
        }
    }
コード例 #3
0
    public _SpineObject LoadFromBundle(int _costumeID)
    {
        AssetBundle  ab      = AssetBundle.LoadFromFile(GetItemLoadPath(DownloadType.ASSET, 6, _costumeID));
        GameObject   objHero = (GameObject)ab.LoadAsset(_costumeID + "_0", typeof(GameObject));
        _SpineObject hero    = objHero.GetComponent <_SpineObject> ();

        ab.Unload(false);
        return(hero);

        //if (!dictStandHeroes.ContainsKey (_costumeID))
        //{
        //    AssetBundle ab = AssetBundle.LoadFromFile (GetItemLoadPath (DownloadType.ASSET, 6, _costumeID));
        //    GameObject objHero = (GameObject) ab.LoadAsset (_costumeID + "_0", typeof (GameObject));
        //    _SpineObject hero = objHero.GetComponent<_SpineObject> ();
        //    dictStandHeroes.Add (_costumeID, hero);
        //    ab.Unload (false);
        //    return hero;
        //}
        //else
        //{
        //    return dictStandHeroes[_costumeID];
        //}
    }