Exemplo n.º 1
0
    private Sprite SearchSubMapTypeSprite(SubMapType type)
    {
        switch (type)
        {
        case SubMapType.Mountain:
            return(mountainAvatar);

        case SubMapType.Lake:
            return(lakeAvatar);

        case SubMapType.Forest:
            return(forestAvatar);

        case SubMapType.Grassland:
            return(grasslandAvatar);

        default:
            return(null);
        }
    }
Exemplo n.º 2
0
    public void UpdateInfo(SubMapManager subMapManager, List <GameObject> aves, SubMapType type)
    {
        string[] avesNames = new string[3];
        for (int i = 0; i < 3; ++i)
        {
            if (i < aves.Count)
            {
                avesNames[i] = aves[i].name;
            }
            else
            {
                avesNames[i] = null;
            }
        }
        for (int i = 0; i < 3; ++i)
        {
            Sprite s = SearchAvesAvatarSprite(avesNames[i]);
            if (s != null)
            {
                avatars[i].sprite = s;
            }
        }
        currentSubMapManager = subMapManager;
        //subMapTypeImage.sprite = SearchSubMapTypeSprite(type);
        var sprite = SearchSubMapTypeSprite(type);

        if (sprite != null)
        {
            subMapTypeImage.sprite = sprite;
        }
        else
        {
            Debug.LogError("未获取地图类型的头像");
        }

        Debug.Log("刷新信息面板");
    }