/// <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); }
public void DisableMinimapIcon() //a method that disables the minimap icon { Icon?.GetComponent <EffectObj>().Disable(); Icon = null; }
public void UpdateMinimapIcon(MinimapIcon newIcon) { Icon = newIcon; }