/// <summary> /// 버튼의 image와 text를 해당 npc에 맞게 교체 /// </summary> public void OpenButton(Npc npcData) { npcname = npcData.npcName; npccode = npcData.npcCode; characterName.text = npcname; characterImage.sprite = Resources.Load <Sprite>("UI/npc icon/" + ((int)npccode).ToString()) as Sprite; }
public void OnDetailUI(NPCCode npccode, string npcname) { if (!detailActive) { detailActive = true; detailView.SetActive(detailActive); detailNameText.text = npcname; detailContentText.text = npcExplains[(int)npccode]; detailImage.GetComponent <Image>().sprite = Resources.Load <Sprite>("UI/npc icon/" + ((int)npccode).ToString()) as Sprite; } }
/// <summary> /// npcActive를 true로 변경 /// </summary> /// <param name="npccode"></param> public void SetNpcActive(NPCCode npccode) { npcActive[(int)npccode] = true; }
public static async Task <List <Point> > GetPathToNPC(this IPathingService pathingService, Game game, NPCCode NPCCode, MovementMode movementMode) { return(await pathingService.GetPathToNPC(game.MapId, Difficulty.Normal, game.Area, game.Me.Location, NPCCode, movementMode)); }
public void OpenButtonMain() { npcname = "주인공"; npccode = NPCCode.MAIN; }
public static WorldObject GetUniqueNPC(Game game, NPCCode npcCode) { return(game.GetNPCsByCode(npcCode).FirstOrDefault()); }
public async Task <List <Point> > GetPathToNPC(uint mapId, Difficulty difficulty, Area area, Point fromLocation, NPCCode npcCode, MovementMode movementMode) { var map = await _mapApiService.GetArea(mapId, difficulty, area); if (map.Npcs.TryGetValue((int)npcCode, out var points) && points.Count > 0) { return(GetPath(mapId, difficulty, area, map, movementMode, fromLocation, points.First())); } return(new List <Point>()); }
// Methods public AssignNPC(byte[] data) : base(data) { this.uid = BitConverter.ToUInt32(data, 1); this.id = (NPCCode) BitConverter.ToUInt16(data, 5); this.x = BitConverter.ToUInt16(data, 7); this.y = BitConverter.ToUInt16(data, 9); this.life = data[11]; }
// Methods public AssignMerc(byte[] data) : base(data) { this.id = (NPCCode) BitConverter.ToUInt16(data, 2); this.ownerUID = BitConverter.ToUInt32(data, 4); this.uid = BitConverter.ToUInt32(data, 8); }
// Methods public InformationMessage(byte[] data) : base(data) { this.slayerType = UnitType.NotApplicable; this.charClass = CharacterClass.NotApplicable; this.slayerObject = GameObjectID.NotApplicable; this.slayerMonster = NPCCode.NotApplicable; this.informationType = PlayerInformationActionType.None; this.relationType = PlayerRelationActionType.NotApplicable; this.amount = -1; this.type = (InformationMessageType) data[1]; this.actionType = data[2]; switch (this.type) { case InformationMessageType.DroppedFromGame: case InformationMessageType.JoinedGame: case InformationMessageType.LeftGame: this.subjectName = ByteConverter.GetNullString(data, 8); this.objectName = ByteConverter.GetNullString(data, 0x18); return; case ((InformationMessageType) 1): case ((InformationMessageType) 5): break; case InformationMessageType.NotInGame: this.subjectName = ByteConverter.GetNullString(data, 8); return; case InformationMessageType.PlayerSlain: this.slayerType = (UnitType) data[7]; this.subjectName = ByteConverter.GetNullString(data, 8); if (this.slayerType != UnitType.Player) { if (this.slayerType == UnitType.NPC) { this.slayerMonster = (NPCCode) BitConverter.ToUInt32(data, 3); return; } if (this.slayerType == UnitType.GameObject) { this.slayerObject = (GameObjectID) BitConverter.ToUInt32(data, 3); return; } break; } this.charClass = (CharacterClass) BitConverter.ToUInt32(data, 3); this.objectName = ByteConverter.GetNullString(data, 0x18); return; case InformationMessageType.PlayerRelation: this.informationType = (PlayerInformationActionType) this.actionType; this.objectUID = BitConverter.ToUInt32(data, 3); this.relationType = (PlayerRelationActionType) data[7]; return; case InformationMessageType.SoJsSoldToMerchants: this.amount = BitConverter.ToInt32(data, 3); break; default: return; } }