Esempio n. 1
0
    public Sprite AddMarker(MinimapIconType iconType)
    {
        Sprite newMarker = (Sprite)icons[iconType].Duplicate();

        Markers.AddChild(newMarker);
        newMarker.Show();
        return(newMarker);
    }
Esempio n. 2
0
    public MiniMapIcon AddStaticIcon(MinimapIconType type, Vector2i tilePos)
    {
        prefab.type = type;
        MiniMapIcon icon = Instantiate(prefab, transform);

        icon.UpdateIcon(tilePos);
        icons.Add(icon);
        return(icon);
    }
 public GameObject Track(Transform transform, MinimapIconType iconType)
 {
     Object prefab = null;
     switch (iconType)
     {
         case MinimapIconType.RedPlayer:
             prefab = redPlayerIconPrefab;
             break;
         case MinimapIconType.BluePlayer:
             prefab = bluePlayerIconPrefab;
             break;
         case MinimapIconType.RedFlag:
             prefab = redFlagIconPrefab;
             break;
         case MinimapIconType.BlueFlag:
             prefab = blueFlagIconPrefab;
             break;
     }
     var icon = (GameObject)Object.Instantiate(prefab, Vector3.zero, Quaternion.identity);
     icons.Add(new MinimapIcon(transform, icon));
     return icon;
 }