/// <summary> /// 寫入座位位置根據索引值。 /// </summary> public void SetSeatPos(int seatIndex, Vector3 pos, bool isCustom) { if (seatIndex < seatingPlan.seats.Count) { seatingPlan.seats[seatIndex].seatPos = pos; seatingPlan.seats[seatIndex].isCustomPos = isCustom; OnSeatModified?.Invoke(seatIndex, seatingPlan.seats[seatIndex]); Save(); } }
/// <summary> /// 設定座位角色。 /// </summary> public void SetCharacter(RoleInfo roleInfo, int seatIndex) { if (roleInfo == null) { seatingPlan.seats[seatIndex].role = null; } else if (seatIndex < seatingPlan.seats.Count) { roleInfo.seatIndex = seatIndex; seatingPlan.seats[seatIndex].role = roleInfo; } OnSeatModified?.Invoke(seatIndex, seatingPlan.seats[seatIndex]); Save(); }