//------------------------------------------------------------------------------------------------- // unity methods //------------------------------------------------------------------------------------------------- public void Awake() { //get the icon image mImage = GetComponentInChildren <Image>(); mActive = false; mIconType = GameTypes.IconType.Unknown; }
private void makeIcon(Entity ent, GameTypes.IconType itype) { IconPanel ip = Instantiate(ObjectManager.getMenu("IconPanel"), mCameraSpaceCanvas.transform).GetComponent <IconPanel>(); ip.mEntity = ent; ip.mIconType = itype; ip.mActive = true; //add it to the list to keep track mIcons.Add(ip); }
public void makeIconIfNeeded(Entity ent) { //make an icon of the given type for the given entity if its necessary if (ent.hasIcon() == true) { return; } GameTypes.IconType itype = needsIcon(ent); if (itype != GameTypes.IconType.Unknown) { makeIcon(ent, itype); } }