Exemple #1
0
        //Add a new marker of TYPE p_type on the MarkerList
        public void AddNewMarker(MinimapMarker p_marker, TYPE p_type)
        {
            if (!_markerList.Contains(p_marker))
            {
                switch (p_type)
                {
                case TYPE.PLAYER:
                    p_marker.SetSprite(playerSprite);
                    p_marker.SetMarkerType(TYPE.PLAYER);
                    break;

                case TYPE.ALLY:
                    p_marker.SetSprite(allySprite);
                    p_marker.SetMarkerType(TYPE.ALLY);
                    break;

                case TYPE.ENEMY:
                    p_marker.SetSprite(enemySprite);
                    p_marker.SetMarkerType(TYPE.ENEMY);
                    break;

                case TYPE.UNIQUE:
                    p_marker.SetMarkerType(TYPE.UNIQUE);
                    break;
                }
                _markerList.Add(p_marker);
            }
        }
Exemple #2
0
 //Enables the Marker. Must be
 public void EnableMarker()
 {
     if (minimapManager == null)
     {
         minimapManager = FindObjectOfType <MinimapManager>();
     }
     if (marker != null)
     {
         if (!marker.isActiveAndEnabled)
         {
             marker.gameObject.SetActive(true);
         }
         if (!_init)
         {
             marker = Instantiate(marker);
             marker.Initialize(targetTransform);
             minimapManager.AddNewMarker(marker, objectType);
             marker.SetFollow(shouldFollow);
             _init = true;
         }
         else
         {
             minimapManager.ResetMarkerSprite(marker);
         }
         if (markerSprite != null && objectType == TYPE.UNIQUE)
         {
             marker.SetSprite(markerSprite);
         }
     }
 }
Exemple #3
0
        //Resets Marker sprite to Default TYPE sprite
        public void ResetMarkerSprite(MinimapMarker p_marker)
        {
            switch (p_marker.GetMarkerType())
            {
            case TYPE.PLAYER:
                p_marker.SetSprite(playerSprite);
                break;

            case TYPE.ALLY:
                p_marker.SetSprite(allySprite);
                break;

            case TYPE.ENEMY:
                p_marker.SetSprite(enemySprite);
                break;
            }
            p_marker.SetFollow(true);
        }
Exemple #4
0
        //Set Death Sprite for marker
        public void MarkerDied(MinimapMarker p_marker)
        {
            switch (p_marker.GetMarkerType())
            {
            case TYPE.PLAYER:
                p_marker.SetSprite(playerDeathSprite);
                break;

            case TYPE.ALLY:
                p_marker.SetSprite(allyDeathSprite);
                break;

            case TYPE.ENEMY:
                p_marker.SetSprite(enemyDeathSprite);
                break;
            }
            p_marker.SetFollow(false);
        }