public override void NodeGUI() { GUILayout.Label("打字类型"); tapType = (TapType)EditorGUILayout.EnumPopup(tapType); // Display Float connections GUILayout.BeginHorizontal(); inputKnob.DisplayLayout(); outputKnob.DisplayLayout(); GUILayout.EndHorizontal(); GUILayout.BeginVertical(); scroll = EditorGUILayout.BeginScrollView(scroll, GUILayout.Height(80)); EditorStyles.textField.wordWrap = false; DialogLine = EditorGUILayout.TextArea(DialogLine, GUILayout.ExpandHeight(true)); EditorStyles.textField.wordWrap = false; EditorGUILayout.EndScrollView(); GUILayout.EndVertical(); /* * // Get adjacent flow elements * Node flowSource = flowIn.connected ()? flowIn.connections[0].body : null; * List<Node> flowTargets = flowOut.connections.Select ((ConnectionKnob input) => input.body).ToList (); * * // Display adjacent flow elements * GUILayout.Label ("Flow Source: " + (flowSource != null? flowSource.name : "null")); * GUILayout.Label ("Flow Targets:"); * foreach (Node flowTarget in flowTargets) * GUILayout.Label ("-> " + flowTarget.name); */ }
private void AddTab(TapType type, string path = SettingsHandler.ROOT_FOLDER) { if (this._contextMenu == null) { CreateContextMenu(); } IPage page; switch (type) { case TapType.EXPLORER: page = CreateExplorer(path); break; case TapType.SETTINGS: page = CreateSettings(); break; case TapType.EMPTY: page = CreateEmpty(); break; case TapType.THEME: page = CreateTheme(); break; default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } AddTabToTabControl(CreateTabItem(page, type.ToString())); }
public static Movement TapTypeToMovement (TapType tap) { switch (tap) { case TapType.Force: return Movement.JustDown; case TapType.PassiveBegin: return Movement.JustDownOrStayDown; case TapType.PassiveStay: return Movement.StayDown; case TapType.PassiveEnd: return Movement.Relax; } throw new ArgumentException(); }
public List<int> getIndices (TapType tap_type) { List<int> result = new List<int>(); for (int i = 0; i < notes.Count; ++i) { if (notes[i].tap == tap_type) { result.Add(i); } } return result; }
public int getCount (TapType tap_type) { int result = 0; foreach (Note n in notes) { if (n.tap == tap_type) { ++result; } } return result; }
private void ShootRay(Ray shotRay, TapType type) { Debug.DrawRay(shotRay.origin, shotRay.direction, Color.red, 5); RaycastHit hit;//Info on the object the ray hit if (Physics.Raycast(shotRay.origin, shotRay.direction, out hit)) { hit.transform.gameObject.GetComponent <BaseEnemy>().GetHit(damage, type); } }
static public bool IsSubstantial(this TapType item) { switch (item) { case TapType.LongTap: case TapType.ShortTap: return(true); } return(false); }
TaperGroup FindAGroup(TapType type) { if (m_TapGroup.ContainsKey(type)) { int index = Random.Range(0, m_TapGroup [type].Count); return(m_TapGroup [type] [index]); } //CommonLogger.LogWarning (string.Format ("{0} has no {1} TapGroup", m_ModelObj.name, type.ToString ())); return(null); }
void InterpretButton(List <byte> buffer, out Button button, out TapType tapType) { char pressLen = (char)buffer.Take(buffer.Count() - 1).Last(); if (buffer[0] == 'X') { if (buffer[1] == '1') { button = Button.AUX1; } else if (buffer[1] == '2') { button = Button.AUX2; } else if (buffer[1] == '3') { button = Button.AUX3; } else { throw new NotImplementedException($"Button X{(char)buffer[1]} not implemented"); } } else if (buffer[0] == 'S' || buffer[0] == 'L' || buffer[0] == 'C') { button = Button.Knob; } else { throw new NotImplementedException($"Button {(char)buffer[0]} not implemented"); } if (pressLen == 'S') { tapType = TapType.Single; } else if (pressLen == 'C') { tapType = TapType.Double; } else if (pressLen == 'L') { tapType = TapType.Long; } else { throw new NotImplementedException($"Tap type {(char)pressLen} not implemented"); } }
/// <summary> /// Checks collision /// </summary> /// <param name="collision">The colliding object, plus other info</param> public override void GetHit(float damage, TapType type) { if (type == TapType.shortTap) { Vector3 temp = Random.insideUnitCircle.normalized; Vector3 position = transform.position + new Vector3(temp.x * 3, temp.y, 0);//sets position to a random spot near the original object GameObject tempObject = GameObject.Instantiate(gameObject, position, Quaternion.identity); tempObject.GetComponent <LongEnemy>().isClone = true; tempObject.transform.LookAt(Camera.main.transform); } else if (type == TapType.longTap) { base.TakeDamage(this.damage); } }
TaperGroup FindTapGroup(TapType type, int group_id) { if (!m_TapGroup.ContainsKey(type)) { m_TapGroup [type] = new List <TaperGroup> (); return(null); } foreach (TaperGroup tg in m_TapGroup[type]) { if (tg.Type == type && tg.Group == group_id) { return(tg); } } return(null); }
public bool GetMouseButtonUp(out TapType tapType) { tapType = TapType.None; if (!Input.GetMouseButtonUp(0)) { return(false); } tapType = TapType.UI; if (IsTapUI()) { return(true); } tapType = TapType.Stand; if (IsTapStand()) { return(true); } tapType = TapType.Space; return(true); }
public Note (string name, TapType tap) { this.name = name; this.tap = tap; }
public virtual void Tap(WorldPress world_press, TapType type) { }
public int getNotCount (TapType tap_type) { return notes.Count - getCount(tap_type); }
public TaperGroup(int group_id, TapType type) { this.Group = group_id; this.Type = type; }
public int indexOf (TapType tap_type) { for (int i = 0; i < notes.Count; ++i) { if (notes[i].tap == tap_type) { return i; } } return -1; }
/// <summary> /// Checks collision. This enemy doesn't care what kind of tap hits it, so type is ignored /// </summary> /// <param name="collision">The colliding object, plus other info</param> public override void GetHit(float damage, TapType type) { base.TakeDamage(this.damage); }
public Part (TapType tap, Panel panel) : this(TapTypeToMovement(tap), panel) { }
public StreamTap(TapType type, string name, int delay, float sampleRate) : base(type, name, delay) { mSampleRateRatio = sampleRate; }
public Tap(TapType tapType, string name, int delay) { mType = tapType; mName = name; mDelay = delay; }
/// <summary> /// Checks collision /// </summary> /// <param name="collision">The colliding object, plus other info</param> abstract public void GetHit(float damage, TapType type);
static void ButtonPushHandler(Button which, TapType how) { Console.WriteLine($"{which} {how}"); }
public bool hasTapTypeOrNoneOnly (TapType tap_type) { foreach (Note n in notes) { if (n.tap != tap_type && n.tap != TapType.None) { return false; } } return true; }