Пример #1
0
    public void HandleTileRemovedFromREM(EventTileRemovedFromREM p_event)
    {
        m_tiles.RemoveAt(p_event.index);
        for (int i = 0; i < p_event.index; i++) {
            Vector3 destination = new Vector3(m_delta_tile_world,0,0);
            SmoothTranslation.Translate(m_tiles[p_event.index - i - 1].gameObject, destination, i / 2.0f, TranslationType.DESTROY_ON_DESTINATION);
            m_tiles[i].index = i+1;
        }

        Vector3 screenPoint = new Vector3 ((Screen.width - m_width_tiles) / 2, 70, m_cam.nearClipPlane + 5);
        Vector3 worldPos = m_cam.ScreenToWorldPoint (screenPoint);
        m_tiles.Insert(0, TileView.InstantiateForRealEstateMarket (p_event.newTile, 0, worldPos, 1));
    }
Пример #2
0
    public void HandleTileRemovedFromREM(EventTileRemovedFromREM p_event)
    {
        m_tiles.RemoveAt(p_event.index);
        for (int i = 0; i < p_event.index; i++)
        {
            Vector3 destination = new Vector3(m_delta_tile_world, 0, 0);
            SmoothTranslation.Translate(m_tiles[p_event.index - i - 1].gameObject, destination, i / 2.0f, TranslationType.DESTROY_ON_DESTINATION);
            m_tiles[i].index = i + 1;
        }

        Vector3 screenPoint = new Vector3((Screen.width - m_width_tiles) / 2, 70, m_cam.nearClipPlane + 5);
        Vector3 worldPos    = m_cam.ScreenToWorldPoint(screenPoint);

        m_tiles.Insert(0, TileView.InstantiateForRealEstateMarket(p_event.newTile, 0, worldPos, 1));
    }