微信登录

Player - RoleData.cs - 玩家_方向

  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. }
Player - RoleData.cs - 玩家_方向