public override void Undo() { foreach (var lyric in Items) { TargetList.Remove(lyric); } }
private void RemoveGridTarget(IMyCubeGrid grid) { foreach (var item in m_validBeaconedGrids) { if (item.MainGrid == grid) { using (Lock.AcquireExclusiveUsing()) { foreach (var block in item.RemoveList) { PotentialTargetList.Remove(block); TargetList.Remove(block); } } m_validBeaconedGrids.Remove(item); break; } } if (m_areaTargetBlocks.ContainsKey(grid)) { m_areaTargetBlocks.Remove(grid); } }
// Start is called before the first frame update public override void FindTargets() { for (int i = 0; i < EnemyManager.Singleton.enemyList.Count; i++) { if (EnemyManager.Singleton.enemyList[i].secondName != "Grape") { if (!TargetList.Contains(EnemyManager.Singleton.enemyList[i])) { if ((EnemyManager.Singleton.enemyList[i].transform.position - towerPosition).magnitude <= range) { print(EnemyManager.Singleton.enemyList[i].secondName); TargetList.Add(EnemyManager.Singleton.enemyList[i]); } } else { if ((EnemyManager.Singleton.enemyList[i].transform.position - towerPosition).magnitude > range) { TargetList.Remove(EnemyManager.Singleton.enemyList[i]); } } } } SortTargetList(); }
public virtual void Remove(object target) { TargetList.Remove(target); using (Lock.AcquireExclusiveUsing()) PotentialTargetList.Remove(target); }
public override void Do() { foreach (var item in Items) { TargetList.Remove(item); } }
public override void FindTargets() { for (int i = 0; i < EnemyManager.Singleton.enemyList.Count; i++) { // if (EnemyManager.Singleton.enemyList[i].enemySpeed > 1.25f) {// Only Targets Bikes if (!TargetList.Contains(EnemyManager.Singleton.enemyList[i])) { if ((EnemyManager.Singleton.enemyList[i].transform.position - towerPosition).magnitude <= range) { TargetList.Add(EnemyManager.Singleton.enemyList[i]); Fire(); } } else { if ((EnemyManager.Singleton.enemyList[i].transform.position - towerPosition).magnitude > range) { EnemyManager.Singleton.enemyList[i].enemySpeed = EnemyManager.Singleton.enemyList[i].enemySpeed / .85f; TargetList.Remove(EnemyManager.Singleton.enemyList[i]); } } // } } // SortTargetList(); }
private void ItemSort(Lyric sourceLyric) { int id = TargetList.IndexOf(sourceLyric); bool isMove = false; for (int i = id; i > 0; i--) { Lyric beforeLyric = TargetList[i - 1]; Lyric currentLyric = TargetList[i]; if (currentLyric != sourceLyric) { break; } if (currentLyric.CompareTo(beforeLyric) < 0) { TargetList.Insert(i + 1, beforeLyric); TargetList.Remove(beforeLyric); isMove = true; } } if (!_isInvoked && isMove && !_changedList.Contains(sourceLyric)) { _changedList.Add(sourceLyric); } }
public override void Undo() { foreach (Lyric lyric in _addItems) { TargetList.Remove(lyric); } }
public override void Undo() { foreach (var item in Positions.Where(d => _changedList.Contains(d.Value))) { TargetList.Remove(item.Value); TargetList.Insert(item.Key, item.Value); } }
private void OnTriggerExit(Collider other) { CharacterMono target = other.GetComponent <CharacterMono>(); if (target != null) { TargetList.Remove(target); if (HaloSkillCancelExecute != null && speller != null) { HaloSkillCancelExecute(speller, target); } } }
private async void DeleteTarget(object obj) { Target deleteTarget = obj as Target; if (deleteTarget != null) { deleteTarget.ChangeItemVisibility(); var result = await Task.Run(() => TikTak()); if (result) { TargetList.Remove(deleteTarget); } else { deleteTarget.ChangeItemVisibility(); } } }
private void FilterTargetList(TargetList targets, LayerMask mask, Vector3 fromPos, Color debugLineColor) { #if UNITY_EDITOR var debugRemoveNames = new List<string>(); #endif Vector3 toPos; bool isNotLOS; var iterTargets = new List<Target>(targets); foreach (Target target in iterTargets) { isNotLOS = false; toPos = target.targetable.xform.position; if (this.testMode == TEST_MODE.SixPoint) { var sweep = new List<Vector3>(); sweep.Add(new Vector3(toPos.x + this.radius, toPos.y, toPos.z)); sweep.Add(new Vector3(toPos.x, toPos.y + this.radius, toPos.z)); sweep.Add(new Vector3(toPos.x, toPos.y, toPos.z + this.radius)); sweep.Add(new Vector3(toPos.x - this.radius, toPos.y, toPos.z)); sweep.Add(new Vector3(toPos.x, toPos.y - this.radius, toPos.z)); sweep.Add(new Vector3(toPos.x, toPos.y, toPos.z - this.radius)); foreach (Vector3 pos in sweep) { isNotLOS = Physics.Linecast(fromPos, pos, mask); #if UNITY_EDITOR if (this.debugLevel > DEBUG_LEVELS.Off) Debug.DrawLine(fromPos, pos, debugLineColor, 0.01f); #endif // Quit loop at first positive test if (isNotLOS) continue; else break; } } else { isNotLOS = Physics.Linecast(fromPos, toPos, mask); #if UNITY_EDITOR if (this.debugLevel > DEBUG_LEVELS.Off) Debug.DrawLine(fromPos, toPos, debugLineColor, 0.01f); #endif } if (isNotLOS) { targets.Remove(target); #if UNITY_EDITOR debugRemoveNames.Add(target.targetable.name); #endif } } #if UNITY_EDITOR if (this.debugLevel == DEBUG_LEVELS.High && debugRemoveNames.Count > 0) Debug.Log("Holding fire for LOS: " + string.Join(",", debugRemoveNames.ToArray())); #endif }
/// <summary> /// 删除对象 /// </summary> /// <param name="member">被删除对象</param> public void Remove(PositionObject member) { // 将member中的数据清除 member.Clear(); targetList.Remove(member); }
public virtual void Remove(object target) { TargetList.Remove(target); PotentialTargetList.Remove(target); }
public void ExitPassenger(Person person) { Passengers.Remove(person); TargetList.Remove(CurrentFloor); }
protected void FilterFireTargetList(TargetList targets) { // Get the position expected to be used to fire from. Vector3 fromPos = this.origin.position; #if UNITY_EDITOR var debugRemoveNames = new List<string>(); #endif this.iterTargets.Clear(); this.iterTargets.AddRange(targets); float dist; for (int i = 0; i < iterTargets.Count; i++) { this.currentTarget = iterTargets[i]; dist = this.currentTarget.targetable.GetDistToPos(fromPos); // Skip if the target is in the distance range if (dist > this.minDistance && dist < this.maxDistance) { #if UNITY_EDITOR if (this.debugLevel > DEBUG_LEVELS.Off) Debug.DrawLine ( fromPos, this.currentTarget.targetable.transform.position, Color.green, 0.01f ); #endif continue; } #if UNITY_EDITOR if (this.debugLevel > DEBUG_LEVELS.Off) Debug.DrawLine ( fromPos, this.currentTarget.targetable.transform.position, Color.red, 0.01f ); #endif targets.Remove(this.currentTarget); #if UNITY_EDITOR debugRemoveNames.Add(this.currentTarget.targetable.name); #endif } #if UNITY_EDITOR if (this.debugLevel == DEBUG_LEVELS.High && debugRemoveNames.Count > 0) { string msg = string.Format ( "Holding fire due to distance: {0}", string.Join(", ", debugRemoveNames.ToArray()) ); Debug.Log(string.Format("{0}: {1}", this, msg)); } #endif }
protected void FilterTargetList(TargetList targets) { #if UNITY_EDITOR var debugRemoveNames = new List<string>(); #endif this.iterTargets.Clear(); this.iterTargets.AddRange(targets); for (int i = 0; i < iterTargets.Count; i++) { this.currentTarget = iterTargets[i]; if (this.IsInAngle(this.currentTarget)) continue; // This target is good. Don't ignore it. Continue. #if UNITY_EDITOR debugRemoveNames.Add(this.currentTarget.targetable.name); #endif targets.Remove(this.currentTarget); } #if UNITY_EDITOR if (this.debugLevel == DEBUG_LEVELS.High && debugRemoveNames.Count > 0) { string msg = string.Format ( "Holding fire due to misalignment: {0}", string.Join(", ", debugRemoveNames.ToArray()) ); Debug.Log(string.Format("{0}: {1}", this, msg)); } #endif }
private void FilterTargetList(TargetList targets, LayerMask mask, Vector3 fromPos, Color debugLineColor) { #if UNITY_EDITOR var debugRemoveNames = new List <string>(); #endif Vector3 toPos; bool isNotLOS; var iterTargets = new List <Target>(targets); foreach (Target target in iterTargets) { isNotLOS = false; toPos = target.targetable.xform.position; if (this.testMode == TEST_MODE.SixPoint) { var sweep = new List <Vector3>(); sweep.Add(new Vector3(toPos.x + this.radius, toPos.y, toPos.z)); sweep.Add(new Vector3(toPos.x, toPos.y + this.radius, toPos.z)); sweep.Add(new Vector3(toPos.x, toPos.y, toPos.z + this.radius)); sweep.Add(new Vector3(toPos.x - this.radius, toPos.y, toPos.z)); sweep.Add(new Vector3(toPos.x, toPos.y - this.radius, toPos.z)); sweep.Add(new Vector3(toPos.x, toPos.y, toPos.z - this.radius)); foreach (Vector3 pos in sweep) { isNotLOS = Physics.Linecast(fromPos, pos, mask); #if UNITY_EDITOR if (this.debugLevel > DEBUG_LEVELS.Off) { Debug.DrawLine(fromPos, pos, debugLineColor, 0.01f); } #endif // Quit loop at first positive test if (isNotLOS) { continue; } else { break; } } } else { isNotLOS = Physics.Linecast(fromPos, toPos, mask); #if UNITY_EDITOR if (this.debugLevel > DEBUG_LEVELS.Off) { Debug.DrawLine(fromPos, toPos, debugLineColor, 0.01f); } #endif } if (isNotLOS) { targets.Remove(target); #if UNITY_EDITOR debugRemoveNames.Add(target.targetable.name); #endif } } #if UNITY_EDITOR if (this.debugLevel == DEBUG_LEVELS.High && debugRemoveNames.Count > 0) { Debug.Log("Holding fire for LOS: " + string.Join(",", debugRemoveNames.ToArray())); } #endif }
protected void FilterTargetList(TargetList targets, LayerMask mask, Vector3 fromPos, Color debugLineColor) { #if UNITY_EDITOR var debugRemoveNames = new List<string>(); #endif Vector3 toPos; bool isNotLOS; var iterTargets = new List<Target>(targets); Collider targetColl; foreach (Target target in iterTargets) { isNotLOS = false; if (this.testMode == TEST_MODE.BoundingBox) { targetColl = target.targetable.coll; // This solution works with rotation pretty well Matrix4x4 mtx = target.targetable.transform.localToWorldMatrix; Vector3 ext = targetColl.bounds.extents * 0.5f; var bboxPnts = new Vector3[8]; bboxPnts[0] = mtx.MultiplyPoint3x4(ext); bboxPnts[1] = mtx.MultiplyPoint3x4(new Vector3(-ext.x, ext.y, ext.z)); bboxPnts[2] = mtx.MultiplyPoint3x4(new Vector3(ext.x, ext.y, -ext.z)); bboxPnts[3] = mtx.MultiplyPoint3x4(new Vector3(-ext.x, ext.y, -ext.z)); bboxPnts[4] = mtx.MultiplyPoint3x4(new Vector3(ext.x, -ext.y, ext.z)); bboxPnts[5] = mtx.MultiplyPoint3x4(new Vector3(-ext.x, -ext.y, ext.z)); bboxPnts[6] = mtx.MultiplyPoint3x4(new Vector3(ext.x, -ext.y, -ext.z)); bboxPnts[7] = mtx.MultiplyPoint3x4(-ext); for (int i = 0; i < bboxPnts.Length; i++) { isNotLOS = Physics.Linecast(fromPos, bboxPnts[i], mask); // Quit loop at first positive test if (isNotLOS) { #if UNITY_EDITOR if (this.debugLevel > DEBUG_LEVELS.Off) Debug.DrawLine(fromPos, bboxPnts[i], debugLineColor, 0.01f); #endif continue; } else break; } } else { toPos = target.targetable.transform.position; isNotLOS = Physics.Linecast(fromPos, toPos, mask); #if UNITY_EDITOR if (isNotLOS && this.debugLevel > DEBUG_LEVELS.Off) Debug.DrawLine(fromPos, toPos, debugLineColor, 0.01f); #endif } if (isNotLOS) { targets.Remove(target); #if UNITY_EDITOR debugRemoveNames.Add(target.targetable.name); #endif } } #if UNITY_EDITOR if (this.debugLevel == DEBUG_LEVELS.High && debugRemoveNames.Count > 0) Debug.Log("Holding fire for LOS: " + string.Join(",", debugRemoveNames.ToArray())); #endif }