/// <summary>
        /// Creates a new minimap icon or gets an inactive one.
        /// </summary>
        private MinimapIcon Get(Transform source, float size)
        {
            //get a new minimap icon from object pool
            MinimapIcon nextIcon = gameMgr.EffectPool.SpawnEffectObj(prefab,
                                                                     new Vector3(source.position.x, height, source.position.z), prefab.transform.rotation, null, false).GetComponent <MinimapIcon>();

            nextIcon.Init();

            //set the size of the icon
            nextIcon.transform.localScale = Vector3.one * size;
            //set its parent object
            nextIcon.transform.SetParent(source, true);

            return(nextIcon);
        }
Beispiel #2
0
 public void DisableMinimapIcon() //a method that disables the minimap icon
 {
     Icon?.GetComponent <EffectObj>().Disable();
     Icon = null;
 }
Beispiel #3
0
 public void UpdateMinimapIcon(MinimapIcon newIcon)
 {
     Icon = newIcon;
 }