예제 #1
0
 /// <summary>
 /// 重置充电区域
 /// </summary>
 public void ResetChargeArea()
 {
     slider.value = 0;
     occupyState  = OccupyState.Empty;
     playerInfoList.Clear();
     occupyIndependentPlayer.Clear();
     occupyTeamDic.Clear();
     SetStalemateFillActive(false);
     occupyPlayer     = null;
     updateOccupyRate = false;
     flagManager.SetFlagColor(Color.white);
     effectController.CloseEffect();
 }
예제 #2
0
 /// <summary>
 /// 更新占有权值,通过isAdd来控制增加还是减小
 /// </summary>
 /// <param name="isAdd">是否增加</param>
 private void UpdateOccupationValue(bool isAdd)
 {
     if (isAdd && slider.value >= slider.maxValue)           // 增长时到爆表
     {
         occupyState = OccupyState.Full;
     }
     else if (!isAdd && slider.value <= slider.minValue)     // 减小时到最低点
     {
         occupyState = OccupyState.Empty;
     }
     else
     {
         occupyState   = OccupyState.Partly;                 // 修改当前扇区值
         slider.value += (isAdd ? 1 : -1) * TotalWeight * chargeValue * updateTime;
         flagManager.SetFlagColor(Color.Lerp(Color.white, fillImage.color, slider.value / slider.maxValue));
     }
 }