Exemplo n.º 1
0
    public void SetCanvasLayer(eTileLayer layer)
    {
        GameObject canvasObject = transform.Find("Canvas").gameObject;
        int        sortingID    = SortingLayer.NameToID(layer.ToString());

        canvasObject.GetComponent <Canvas>().sortingLayerID = sortingID;
    }
Exemplo n.º 2
0
    override public void SetSortingOrder(eTileLayer layer, int sortingOrder)
    {
        _tileLayer = layer;
        int sortingID = SortingLayer.NameToID(layer.ToString());

        _characterView.GetComponent <SpriteRenderer>().sortingLayerID = sortingID;
        _characterView.GetComponent <SpriteRenderer>().sortingOrder   = sortingOrder;
    }
Exemplo n.º 3
0
    //Sort
    virtual public void SetSortingOrder(eTileLayer layer, int sortingOrder)
    {
        _tileLayer = layer;
        int sortingID = SortingLayer.NameToID(layer.ToString());

        gameObject.GetComponent <SpriteRenderer>().sortingLayerID = sortingID;
        gameObject.GetComponent <SpriteRenderer>().sortingOrder   = sortingOrder;
    }
Exemplo n.º 4
0
    public void AddObject(eTileLayer layer, MapObject mapObject)
    {
        List <MapObject> mapObjectList = _mapObjectMap[(int)layer];

        int sortingID    = SortingLayer.NameToID(layer.ToString());
        int sortingOrder = mapObjectList.Count;

        mapObject.SetSortingOrder(sortingID, sortingOrder);
        mapObject.SetPosition(_position);
        mapObjectList.Add(mapObject);
    }
Exemplo n.º 5
0
    //타일셀 정보에 추가
    public void AddObject(MapObject mapObject, eTileLayer layer, bool setTilePos = true)
    {
        List <MapObject> mapObjectList = _mapObjectListByLayer[(int)layer];

        if (!mapObjectList.Contains(mapObject))         //중복삽입 방지
        {
            mapObjectList.Add(mapObject);
        }

        if (eTileLayer.RANGE == layer)
        {
            return;
        }

        if (eTileLayer.ITEM == layer)
        {
            //아이템: 최신이 제일 앞에 오게
            mapObject.GetComponent <SpriteRenderer>().sortingOrder = _itemLayerOrder;
            _itemLayerOrder++;
        }
        else
        {
            if (eMapObjectType.CHARACTER != mapObject.GetMapObjectType() &&
                eMapObjectType.PLAYER != mapObject.GetMapObjectType() &&
                eMapObjectType.ENEMY != mapObject.GetMapObjectType())
            {
                mapObject.GetComponent <SpriteRenderer>().sortingOrder = _groundLayerOrder;
            }
        }

        mapObject.SetCurrentLayer(layer);

        int sortingLayerID = SortingLayer.NameToID(layer.ToString());

        mapObject.GetComponentInChildren <SpriteRenderer>().sortingLayerID = sortingLayerID;

        if (setTilePos)
        {
            mapObject.SetTilePosition(_tileX, _tileY);
        }
    }