StartPos.cs 841 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using UnityEngine;
  2. using System.Collections;
  3. public class StartPos : MapObject
  4. {
  5. public GameObject[] haloPrefabs;
  6. private GameObject haloObj;
  7. public override void Init (Map map)
  8. {
  9. base.Init (map);
  10. startPositionDirect = StartPostionDirect.Center;
  11. }
  12. public override TeamUtil.Team team {
  13. get {
  14. return base.team;
  15. }
  16. set {
  17. TeamUtil.Team oldTeam = base.team;
  18. base.team = value;
  19. if(oldTeam != value)
  20. {
  21. if(Application.isPlaying || !Application.isEditor)
  22. {
  23. if(haloObj != null)
  24. Destroy(haloObj);
  25. // if(value == TeamUtil.Team.Blue || value == TeamUtil.Team.Red)
  26. // {
  27. // haloObj = Instantiate<GameObject>(haloPrefabs[value.GetHashCode()-1]);
  28. // haloObj.transform.SetParent(this.transform);
  29. // haloObj.transform.localPosition = Vector3.zero;
  30. // }
  31. }
  32. }
  33. }
  34. }
  35. }