private void CreateAutoActions() { Dictionary <int, int> .Enumerator enumerator = battle.autoAction.GetEnumerator(); while (enumerator.MoveNext()) { int pos = enumerator.Current.Key; int targetPos = enumerator.Current.Value; if (pos != targetPos) { GameObject go; if (BattlePublicTools.GetDistance(battle.mapData.mapWidth, pos, targetPos) == 1) { if (battle.GetPosIsMine(pos) == battle.GetPosIsMine(targetPos)) { go = CreateArrow(pos, targetPos, new Color(0, 1, 0, 0.5f), 0); } else { go = CreateArrow(pos, targetPos, new Color(1, 0, 0, 0.5f), 0); } } else { go = CreateShootArrow(pos, targetPos, new Color(1, 1, 0, 0.5f)); } autoActionArrowList.Add(go); } } }
public void MapUnitEnter(MapUnit _unit) { if (downPos != -1) { if (mapData.dic.ContainsKey(_unit.index)) { if (BattlePublicTools.GetDistance(mapData.mapWidth, downPos, _unit.index) == 1) { if (showMyTarget) { mapData.moveMap[downPos] = new KeyValuePair <int, int>(_unit.index, mapData.moveMap[downPos].Value); } else { mapData.moveMap[downPos] = new KeyValuePair <int, int>(mapData.moveMap[downPos].Key, _unit.index); } ShowArrow(downPos, _unit.index); } } } }