private void OnEnable() { if (Application.isPlaying) { Targets.ForEach(t => t.GenericEvent += OnEvent); } }
private void ProcessPointerDown(PointerEventData pointerEventData) { MouseDownOnMe = true; MouseDown(); OriginalPosition = transform.localPosition; TargetStartPositions = new Dictionary <Transform, Vector3>(); Targets.ForEach(t => TargetStartPositions.Add(t, t.position)); Vector3 smp; if (DragInScreenSpace) { smp = Input.mousePosition; } else { RectTransformUtility.ScreenPointToWorldPointInRectangle((RectTransform)transform, Input.mousePosition, ChainView.Instance.Camera, out smp); } StartMousePosition = smp; pointerEventData.Use(); }
public void Render() { switch (MapModel) { case GuideNode entryNode: { _parent.DrawEntryNode(entryNode, Highlighted); return; } case WallNode wallNode: { _parent.DrawWallNode(wallNode, Highlighted); return; } case Link link: { _parent.DrawLink(link, Highlighted); return; } default: { Targets.ForEach(target => target.Render()); return; } } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); if (GUILayout.Button("Update Look At Target")) { Undo.RecordObjects(Targets.Select(t => t.transform as Object).ToArray(), "Look At Target"); Targets.ForEach(t => t.UpdateLook()); } }
internal void DelegateCommand(CommandType primary, string secondary, NetomityObject sourceObject) { Targets.ForEach(t => { Log("Delegating Command: {0} to {1}", primary, t.Name); t.Command(primary: primary, secondary: secondary, sourceObject: sourceObject); } ); }
/// <summary> /// メソッド情報を読み取る /// </summary> private void LoadMethods() { var i = 0; Targets.ForEach ((target) => { Methods[i].GetInfo(target.TargetSelected); i++; }); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); if (Application.isPlaying) { using (new EditorGUI.DisabledGroupScope(!Application.isPlaying || targets.Length != 1)) { EditorUtils.OptionalUnserializedPropertyFieldGUILayout(target, "Value", "Current Value"); } } using (new EditorGUI.DisabledGroupScope(!Application.isPlaying)) { if (GUILayout.Button("Raise")) { Targets.ForEach(t => t.Raise()); } } }
public override void PreProccess() { // TODO 记下伤害值、异常状态 int[,] midpos = new int[, ] { { 92, 52 }, { 109, 63 }, { 126, 74 } }; dxy = new float[Attackers.Count, 2]; oxy = new int[Attackers.Count, 2]; for (int i = 0; i < Attackers.Count; i++) { oxy[i, 0] = Attackers[i].GetCombatX(); oxy[i, 1] = Attackers[i].GetCombatY(); } for (int i = 0; i < Attackers.Count; i++) { dxy[i, 0] = midpos[i, 0] - oxy[i, 0]; dxy[i, 0] /= MOV_FRAME; dxy[i, 1] = midpos[i, 1] - oxy[i, 1]; dxy[i, 1] /= MOV_FRAME; } if (_onlyOneMonster) { mAniX = FirstTarget.GetCombatX(); mAniY = FirstTarget.GetCombatY() - FirstTarget.FightingSprite.Height / 2; } else { mAniX = mAniY = 0; } if (_magic == null) { Animation = Context.LibData.GetSrs(2, 240); } else { Animation = _magic.Animation; Targets.ForEach(m => UseMagic(m)); } Animation.StartAni(); }
public override void Do() { Targets.ForEach(card => card.MoveTo(card.Controller.Hand)); }
public override void Do() { Targets.ForEach(card => card.IsHorizontal = true); }
public void Set100() { Targets.ForEach(x => x.Set100()); }
public void Unhighlight() { Highlighted = false; Targets.ForEach(target => target.Unhighlight()); }
public void Highlight() { Highlighted = true; Targets.ForEach(target => target.Highlight()); }