private static void EntityEvent(EntityEventInfo entityEventInfo) { if (entityEventInfo.entityEventType == ENTITY_EVENT_TYPE.ENTITY_START) { ShowEntity(entityEventInfo); AssignButtons(entityEventInfo); } else { HideEntity(entityEventInfo); } }
private static void AssignButtons(EntityEventInfo entityEventInfo) { _buttonEventHandlers[0].SetEventInfo(null); _buttonEventHandlers[1].SetEventInfo(null); _buttonEventHandlers[2].SetEventInfo(null); _buttonEventHandlers[3].SetText("Talk To"); _buttonEventHandlers[3].SetInteractable(true); _buttonEventHandlers[3].SetEventInfo(entityEventInfo.entity.TalkTo()); }
private static void ShowEntity(EntityEventInfo entityEventInfo) { LocationSystem.HideNamePanel(); if (entityEventInfo.entity.Texture == null) { currentEntity = entityEventInfo.entity; APIHandler.getAPIHandler().FetchImage(entityEventInfo.entity.imagePath, FetchImageCallback); } else { entityImage.sprite = Sprite.Create( entityEventInfo.entity.Texture, new Rect(0, 0, entityEventInfo.entity.Texture.width, entityEventInfo.entity.Texture.height), new Vector2(0.5f, 0.5f)); entityImage.SetMaterialDirty(); UIHelperClass.ShowPanel(entityImageObject, true); } }
private static void HideEntity(EntityEventInfo entityEventInfo) { UIHelperClass.ShowPanel(entityImageObject, false); }