protected override void OnDragDropMove(Vector2 delta) { ProdBattleCommandSelect prodBattleCommandSelect = BattleTaskManager.GetTaskCommand().prodBattleCommandSelect; List <UICommandSurface> listCommandSurfaces = prodBattleCommandSelect.commandBox.listCommandSurfaces; UICommandSurface mainTarget = (from x in listCommandSurfaces orderby(x.transform.position - base.transform.position).magnitude select x).First(); ChkBorderLine(); listCommandSurfaces.ForEach(delegate(UICommandSurface x) { if (x == mainTarget) { x.ChkSurfaceMagnifyDistance(this); } else { x.Reduction(); } }); if (!mainTarget.isAbsorded) { base.OnDragDropMove(delta); } }
public static UICommandSurface Instantiate(UICommandSurface prefab, Transform parent, Vector3 pos, int nIndex, BattleCommand iCommand, Action onSetCommandUnit) { UICommandSurface uICommandSurface = UnityEngine.Object.Instantiate(prefab); uICommandSurface.transform.parent = parent; uICommandSurface.transform.localScale = uICommandSurface._vReductionSize; uICommandSurface.transform.localPosition = pos; uICommandSurface.Init(nIndex, iCommand, onSetCommandUnit); return(uICommandSurface); }
public static UICommandSurface Instantiate(UICommandSurface prefab, Transform parent, Vector3 pos, int nIndex, BattleCommand iCommand, Action onSetCommandUnit) { UICommandSurface uICommandSurface = Object.Instantiate <UICommandSurface>(prefab); uICommandSurface.get_transform().set_parent(parent); uICommandSurface.get_transform().set_localScale(uICommandSurface._vReductionSize); uICommandSurface.get_transform().set_localPosition(pos); uICommandSurface.Init(nIndex, iCommand, onSetCommandUnit); return(uICommandSurface); }
private void CreateSurface(List <BattleCommand> presetList) { _listCommandSurface = new List <UICommandSurface>(); _listICommandSurface = new List <IUICommandSurface>(); int num = 0; foreach (BattleCommand preset in presetList) { _listCommandSurface.Add(UICommandSurface.Instantiate(((Component)_prefabCommandSurface).GetComponent <UICommandSurface>(), base.transform, _listCommandSurfacePos[num] + _strParams.surfaceInitPosOffs, num, preset, ChkAllSurfaceSet)); _listICommandSurface.Add(_listCommandSurface[num]); num++; } }
public void Active2FocusUnit2(UICommandSurface surface, List <BattleCommand> invalidCommands) { if (surface.commandType == BattleCommand.None) { _vSelectCommandPos = Vector2.zero; ChangeFocus(_vSelectCommandPos); } else { BattleCommand iCommand = (!invalidCommands.Contains(surface.commandType)) ? surface.commandType : BattleCommand.Sekkin; _vSelectCommandPos = GetCommandPos(iCommand); ChangeFocus(_vSelectCommandPos); } }
private void CreateSurface(List <BattleCommand> presetList) { this._listCommandSurface = new List <UICommandSurface>(); this._listICommandSurface = new List <IUICommandSurface>(); int num = 0; using (List <BattleCommand> .Enumerator enumerator = presetList.GetEnumerator()) { while (enumerator.MoveNext()) { BattleCommand current = enumerator.get_Current(); this._listCommandSurface.Add(UICommandSurface.Instantiate(this._prefabCommandSurface.GetComponent <UICommandSurface>(), base.get_transform(), this._listCommandSurfacePos.get_Item(num) + this._strParams.surfaceInitPosOffs, num, current, new Action(this.ChkAllSurfaceSet))); this._listICommandSurface.Add(this._listCommandSurface.get_Item(num)); num++; } } }
public void FocusSurfaceMagnify() { UICommandSurface uICommandSurface = Enumerable.FirstOrDefault <UICommandSurface>(this._listCommandSurface, (UICommandSurface x) => !x.isSetUnit); if (this._uiBattleStartBtn.isEnabled) { this.selectIndex = this._uiBattleStartBtn.index; } else if (uICommandSurface != null) { this.selectIndex = uICommandSurface.index; } else { this.selectIndex = 0; } this._listICommandSurface.get_Item(this.selectIndex).Magnify(); }
public void FocusSurfaceMagnify() { UICommandSurface uICommandSurface = _listCommandSurface.FirstOrDefault((UICommandSurface x) => !x.isSetUnit); if (_uiBattleStartBtn.isEnabled) { selectIndex = _uiBattleStartBtn.index; } else if (uICommandSurface != null) { selectIndex = uICommandSurface.index; } else { selectIndex = 0; } _listICommandSurface[selectIndex].Magnify(); }
protected override void OnDragDropMove(Vector2 delta) { ProdBattleCommandSelect prodBattleCommandSelect = BattleTaskManager.GetTaskCommand().prodBattleCommandSelect; List <UICommandSurface> listCommandSurfaces = prodBattleCommandSelect.commandBox.listCommandSurfaces; UICommandSurface mainTarget = Enumerable.First <UICommandSurface>(Enumerable.OrderBy <UICommandSurface, float>(listCommandSurfaces, (UICommandSurface x) => (x.get_transform().get_position() - this.get_transform().get_position()).get_magnitude())); this.ChkBorderLine(); listCommandSurfaces.ForEach(delegate(UICommandSurface x) { if (x == mainTarget) { x.ChkSurfaceMagnifyDistance(this); } else { x.Reduction(); } }); if (!mainTarget.isAbsorded) { base.OnDragDropMove(delta); } }