12345678910111213141516171819202122232425262728293031323334353637383940 |
- using UnityEngine;
- using System.Collections;
- public class FlagBase : MapBase
- {
- public GameObject[] haloPrefabs;
- private GameObject haloObj;
- public override void Init(Map map)
- {
- base.Init(map);
- this.team = team;
- }
- public override TeamUtil.Team team {
- get {
- return base.team;
- }
- set {
- TeamUtil.Team oldTeam = base.team;
- base.team = value;
- if(Application.isPlaying || !Application.isEditor)
- {
- if(haloObj != null)
- Destroy(haloObj);
- if(value == TeamUtil.Team.Blue || value == TeamUtil.Team.Red)
- {
- haloObj = Instantiate<GameObject>(haloPrefabs[value.GetHashCode()-1]);
- haloObj.transform.SetParent(this.transform);
- haloObj.transform.localPosition = Vector3.zero;
- }
- }
- }
- }
- }
|