Ejemplo n.º 1
0
 void Reset()
 {
     Start();
     m_meshRenderer.material = TilemapUtils.FindDefaultSpriteMaterial();
     if (!m_meshFilter.sharedMesh)
     {
         m_meshFilter.sharedMesh = new Mesh();
     }
     m_meshFilter.sharedMesh.name = "Quad";
 }
Ejemplo n.º 2
0
        void Awake()
        {
            BuildTilechunkDictionary();
            var valueIter = m_dicChunkCache.Values.GetEnumerator();

            while (valueIter.MoveNext())
            {
                TilemapChunk chunk = valueIter.Current;
                chunk.gameObject.hideFlags |= HideFlags.HideInHierarchy;
            }

            // NOTE: in game Reset is not called
            if (!m_material)
            {
                m_material  = TilemapUtils.FindDefaultSpriteMaterial();
                m_tintColor = Color.white;
            }
        }
Ejemplo n.º 3
0
        void OnValidate()
        {
            BuildTilechunkDictionary();
            m_parentTilemapGroup = GetComponentInParent <TilemapGroup>();
#if UNITY_EDITOR
            // fix: for tilemaps created with version 1.3.5 or below
            if (m_tintColor == default(Color))
            {
                Debug.Log("Fixing tilemap made with version below 1.3.5: " + name);
                if (m_material)
                {
                    m_tintColor = m_material.color; //take the color from the material
                    m_pixelSnap = Material.HasProperty("PixelSnap") && Material.IsKeywordEnabled("PIXELSNAP_ON");
                    bool fixMaterial = string.IsNullOrEmpty(UnityEditor.AssetDatabase.GetAssetPath(m_material));
                    if (fixMaterial)
                    {
                        m_material = TilemapUtils.FindDefaultSpriteMaterial();
                    }
                }
            }
            //---
#endif
            PixelSnap = m_pixelSnap;
        }
Ejemplo n.º 4
0
 void Reset()
 {
     ClearMap();
     m_material  = TilemapUtils.FindDefaultSpriteMaterial();
     m_tintColor = Color.white;
 }