public void Clear() { CurrentCell = null; //CurrentUnit = null; CurrentCity = null; CurrentActor = null; }
public void Init(ActorVisualizer av) { _actor = av; _pos = _actor.CurrentPosition; _pos.y += 16; _posScreen = HexGameUI.CurrentCamera.WorldToScreenPoint(_pos); transform.position = _posScreen; }
// Start is called before the first frame update void Start() { _actorVisualizer = GetComponentInParent <ActorVisualizer>(); if (!_actorVisualizer) { Debug.LogError("ActorAnimatorEvents Start Error - ActorVisualizer not found!"); } }
public void EnableFollowCamera(ActorVisualizer av, bool bEnable) { if (av == null) { return; } av.transform.Find("CameraFollow").gameObject.SetActive(bEnable); }
public void Init(ActorVisualizer av) { _actor = av; _slider.minValue = 0; _slider.maxValue = av.HpMax; _startTime = 0; _durationTime = av.AttackDuration + _MORE_DELAY_TIME; SetValue(av.Hp); }
public bool IsShowingSelector(ActorVisualizer av) { if (_selectObj.transform.parent == av.transform) { return(true); } return(false); }
/// <summary> /// /// </summary> /// <param name="av"></param> /// <param name="durationTime">剩余的时间</param> /// <param name="totalTime">总时间</param> public void Init(ActorVisualizer av, float durationTime, float totalTime) { _actor = av; _slider.minValue = 0; _slider.maxValue = totalTime; _startTime = totalTime - durationTime; _totalTime = totalTime; SetValue(0); }
public void ShowPath(ActorVisualizer av) { if (av != null && av.ListPath != null && av.ListPath.Count > 0) { hexGrid.ShowPath(av.ListPath); } else { hexGrid.ShowPath(null); } }
public void Play(ActorVisualizer av, int blood) { _actor = av; _blood.text = blood.ToString(); _blood.color = new Color(_blood.color.r, _blood.color.g, _blood.color.b, 1f); _startTime = 0; _pos = _actor.CurrentPosition; _pos.y += 16; _posScreen = HexGameUI.CurrentCamera.WorldToScreenPoint(_pos); transform.position = _posScreen; _posSaved = transform.position; _posEnd = _posSaved + new Vector3(0, _FLY_HEIGHT, 0); _posY = 0; _posEndY = _FLY_HEIGHT; }
public void Play(ActorVisualizer av, string msg, PanelSystemTips.MessageType msgType) { _actor = av; _blood.text = msg; string strColorBeginFormat = "<color={0}>{1}{2}"; string strColorEnd = "</color>"; string msgWithColor = msg; switch (msgType) { case PanelSystemTips.MessageType.Success: msgWithColor = string.Format(strColorBeginFormat, "#7FFF00FF", msg, strColorEnd); break; case PanelSystemTips.MessageType.Error: msgWithColor = string.Format(strColorBeginFormat, "red", msg, strColorEnd); break; case PanelSystemTips.MessageType.Warning: msgWithColor = string.Format(strColorBeginFormat, "yellow", msg, strColorEnd); break; } _blood.text = msgWithColor; _startTime = 0; _pos = _actor.CurrentPosition; _pos.y += 16; _posScreen = HexGameUI.CurrentCamera.WorldToScreenPoint(_pos); transform.position = _posScreen; _posSaved = transform.position; _posEnd = _posSaved + new Vector3(0, _FLY_HEIGHT, 0); _posY = 0; _posEndY = _FLY_HEIGHT; }
private void ShowSelector(ActorVisualizer av, bool bShow) { if (!_selectObj) { return; } _selectObj.SetActive(bShow); if (av) { bShow = bShow & _isFollowCamera; _selectObj.transform.parent = av.transform; _selectObj.transform.localPosition = Vector3.up * 0.2f; ToggleFollowCamera(); SelectCircle sc = _selectObj.GetComponent <SelectCircle>(); if (sc) { sc.SetSize(2); } } else { _selectObj.transform.parent = null; } }