Esempio n. 1
0
    public override void OnInitial(XEntity enty)
    {
        base.OnInitial(enty);
        XEntity e = enty;

        //时装
        TempEquipSuit fashions = new TempEquipSuit();

        m_FashionList = new List <EquipPart>();
        var fashionsuit = XTableMgr.GetTable <FashionSuit>();

        for (int i = 0, max = fashionsuit.length; i < max; ++i)
        {
            FashionSuit.RowData row = fashionsuit[i];
            if (row.FashionID != null)
            {
                XEquipUtil.MakeEquip(row.SuitName, row.FashionID, m_FashionList, fashions, (int)row.SuitID);
            }
        }

        //装备
        m_EquipList = new List <EquipPart>();
        var equipsuit = XTableMgr.GetTable <EquipSuit>();

        for (int i = 0, max = equipsuit.length; i < max; ++i)
        {
            EquipSuit.RowData row = equipsuit[i];
            if (row.EquipID != null)
            {
                XEquipUtil.MakeEquip(row.SuitName, row.EquipID, m_EquipList, fashions, -1);
            }
        }

        Transform skinmesh = e.EntityObject.transform;

        skin = skinmesh.GetComponent <SkinnedMeshRenderer>();
        if (skin == null)
        {
            skin = skinmesh.gameObject.AddComponent <SkinnedMeshRenderer>();
        }
        skin.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
        e.skin = skin;

        for (EPartType part = EPartType.ECombinePartStart; part < EPartType.ECombinePartEnd; ++part)
        {
            parts[(int)part] = new PartLoadTask(part, this);
        }
        for (EPartType part = EPartType.ECombinePartEnd; part < EPartType.EMountEnd; ++part)
        {
            parts[(int)part] = new MountLoadTask(part, this);
        }
        RegisterEvent(XEventDefine.XEvent_Detach_Host, OnDetachHost);

        EquipPart(m_FashionList[0]);
    }
Esempio n. 2
0
    private void LoadFinish(object o)
    {
        MountLoadTask mlt = o as MountLoadTask;

        if (mlt != null)
        {
            if (mlt.processStatus == EProcessStatus.EProcessing)
            {
                mlt.processStatus = EProcessStatus.EPreProcess;
            }
        }
        ProcessRender();
    }