void CreateBuiltInPlane(int nSelIndex)
 {
     if (m_bCreateBuiltInPlane)
     {
         return;
     }
     m_bCreateBuiltInPlane = true;
     if (m_MeshFilter == null)
     {
         if (gameObject.GetComponent <MeshFilter>() != null)
         {
             m_MeshFilter = gameObject.GetComponent <MeshFilter>();
         }
         else
         {
             m_MeshFilter = gameObject.AddComponent <MeshFilter>();
         }
     }
     NcSpriteFactory_B.CreatePlane(m_MeshFilter, m_fUvScale, m_NcSpriteFrameInfos[nSelIndex], m_AlignType, m_MeshType);
 }
Example #2
0
    void UpdateSpriteTexture(bool bShowEffect)
    {
        if (UpdateSpriteMaterial() == false)
        {
            return;
        }
        if (m_NcSpriteFactoryCom.IsValidFactory() == false)
        {
            return;
        }
        if (m_NcSpriteFrameInfos.Length == 0)
        {
            SetSpriteFactoryIndex(m_nSpriteFactoryIndex, m_nFrameIndex, false);
        }

        if (m_MeshFilter == null)
        {
            if (gameObject.GetComponent <MeshFilter>() != null)
            {
                m_MeshFilter = gameObject.GetComponent <MeshFilter>();
            }
            else
            {
                m_MeshFilter = gameObject.AddComponent <MeshFilter>();
            }
        }
        NcSpriteFactory_B.CreatePlane(m_MeshFilter, m_fUvScale, m_NcSpriteFrameInfos[m_nFrameIndex], m_AlignType, m_MeshType);
        NcSpriteFactory_B.UpdateMeshUVs(m_MeshFilter, m_NcSpriteFrameInfos[m_nFrameIndex].m_TextureUvOffset);
//      {
// //           Debug.Log("m_Renderer.material");
//          renderer.material.mainTextureScale	= new Vector2(m_fTilingX, m_fTilingY);
//          renderer.material.mainTextureOffset	= new Vector2(m_fOffsetX, m_fOffsetY);
//      }

        if (bShowEffect)
        {
            m_EffectObject = m_NcSpriteFactoryCom.CreateSpriteEffect(m_nSpriteFactoryIndex, transform);
        }
    }