test_visual_config.py 746 B

1234567891011121314151617181920
  1. import pandas as pd
  2. import json
  3. # 读取Excel文件中的视觉配置
  4. df = pd.read_excel('d:/CocosGame/Pong/assets/resources/data/excel/方块武器配置/方块武器配置表.xlsx', sheet_name='视觉配置')
  5. print("Excel视觉配置数据:")
  6. print(df[['武器ID', '拖尾特效']].head())
  7. # 读取当前的weapons.json文件
  8. with open('d:/CocosGame/Pong/assets/resources/data/weapons.json', 'r', encoding='utf-8') as f:
  9. weapons_data = json.load(f)
  10. print("\nweapons.json中的visualConfig示例:")
  11. for weapon in weapons_data['weapons'][:3]:
  12. print(f"武器ID: {weapon['id']}")
  13. if 'visualConfig' in weapon:
  14. print(f" visualConfig: {weapon['visualConfig']}")
  15. else:
  16. print(" 没有visualConfig字段")
  17. print()