Exemplo n.º 1
0
    public virtual bool SetObjInfo(ObjectInfo ObjInfo)
    {
        m_ObjInfo.Copy(ObjInfo);

        switch (m_ObjInfo.m_eObjState)
        {
        case eObjectState.CS_MYENTITY:
        {
        }
        break;

        case eObjectState.CS_READY:
        case eObjectState.CS_UNENTITY:
        case eObjectState.CS_DEAD:
        {
            if (m_pEntity != null)
            {
                EA_ObjectFactory.EntityUnSetting(this);
            }
        }
        break;


        case eObjectState.CS_SETENTITY:
        {
            if (m_pEntity == null)
            {
                EA_ObjectFactory.EntitySetting(this, m_ObjInfo);
            }

            ChangeModel(m_ObjInfo.m_ModelTypeIndex);
        }
        break;

        case eObjectState.CS_HIDE:
        {
            if (m_pEntity != null)
            {
                m_pEntity.SetActive(false);
            }
        }
        break;

        case eObjectState.CS_SHOW:
        {
            if (m_pEntity != null)
            {
                m_pEntity.SetActive(true);
            }
        }
        break;
        }

        ReSetWorldPosDir(m_ObjInfo.spawnPos, m_ObjInfo.spawnAngle);

        if (m_pEntity != null)
        {
            if (!string.IsNullOrEmpty(m_ObjInfo.m_strGameName))
            {
                m_pEntity.name = m_ObjInfo.m_strGameName;
            }
        }

        return(true);
    }