Ejemplo n.º 1
0
 private void SetBullet(IzCommonEffect effect)
 {
     if (effect.m_kGO == null || effect.m_kTRS == null)
     {
         return;
     }
     if (_gameObject != null)
     {
         GameObjectExt.Destroy(_gameObject);
     }
     _effect                  = effect;
     _gameObject              = _effect.m_kGO;
     _gameObject.name         = "defaultBullet";
     _transform               = _effect.m_kTRS;
     _transform.localPosition = _pos;
     //_transform.forward = _dir;
     //_gameObject.SetActive(false);
 }
Ejemplo n.º 2
0
    public void ReplaceModel(Transform trans)
    {
        if (m_Transform == null && m_DefaultTransform != null)
        {
            trans.parent = m_DefaultTransform.parent;
            trans.gameObject.ResetAll();
            trans.position   = m_DefaultTransform.position;
            trans.rotation   = m_DefaultTransform.rotation;
            trans.localScale = m_DefaultTransform.localScale;
            trans.name       = m_DefaultTransform.name;

            GameObjectExt.Destroy(m_DefaultTransform.gameObject);
            m_Transform        = trans;
            m_DefaultTransform = null;
        }
        else
        {
            throw new ArgumentException(string.Format("m_Transform={0},m_DefaultTransform={1}", m_Transform, m_DefaultTransform));
        }
    }
Ejemplo n.º 3
0
    public void Load(SceneVo Vo, Action <GameObject> callBack = null, string[] preloadAssets = null)
    {
        if (isLoading)
        {
            return;
        }
        UILoading.ShowLoading(string.Concat("正在进入", Vo.id, "场景..."), "正在预加载", 0);
        this.callBack             = callBack;
        this.m_sceneId            = Vo.id;
        SceneMgr.Instance.SceneVo = Vo;
        isLoading          = true;
        _isLoadingComplete = false;
        GameObjectExt.Destroy(m_kScenePrefab);
        // Loadinge
        string[] sceneURLs;
        int      len = 1;

        if (preloadAssets == null)
        {
            sceneURLs = new string[len];
        }
        else
        {
            sceneURLs = new string[len + preloadAssets.Length];
            for (int i = 0; i < preloadAssets.Length; i++)
            {
                sceneURLs[len + i] = preloadAssets[i];
            }
        }
        sceneURLs[0] = URLConst.GetScenePrefab(Vo.id);
        ResourceMgr.Instance.DownLoadBundles(
            sceneURLs,
            DownLoadComplete,
            ResourceMgr.UI_PRIORITY,
            delegate(Resource res, int listCount, int index)
        {
            totalNum++;
        });
    }