• 主页

  • 投资

  • IT

    🔥
  • 设计

  • 销售

  • 共151篇

    Unity - 游戏引擎

关闭

返回栏目

关闭

返回Unity - 游戏引擎栏目

128 - Player - RoleData.cs - 玩家_方向

作者:

贺及楼

成为作者

更新日期:2023-09-17 11:00:23

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Common;
  5. public class RoleData
  6. {
  7. private const string PREFIX_PREFAB = "Prefabs/";
  8. public RoleType RoleType { get; private set; }
  9. public GameObject RolePrefab { get; private set; }
  10. public GameObject ArrowPrefab { get; private set; }
  11. public Vector3 SpawnPosition { get; private set; }
  12. public GameObject ExplostionEffect { get; private set; }
  13. public RoleData(RoleType roleType,string rolePath,string arrowPath,string explosionPath, Transform spawnPos)
  14. {
  15. this.RoleType = roleType;
  16. this.RolePrefab = Resources.Load(PREFIX_PREFAB+ rolePath) as GameObject;
  17. this.ArrowPrefab = Resources.Load(PREFIX_PREFAB + arrowPath) as GameObject;
  18. this.ExplostionEffect = Resources.Load(PREFIX_PREFAB + explosionPath) as GameObject;
  19. ArrowPrefab.GetComponent<Arrow>().explosionEffect = ExplostionEffect;
  20. this.SpawnPosition = spawnPos.position;
  21. }
  22. }