private static bool CheckScope(Control c) { switch(c.scope) { case Scope.ReleaseOnly: return Application.isEditor == false; case Scope.EditorOnly: return Application.isEditor; default: return true; } }
private static void UpdateControl(Control c) { if(CheckScope(c)) { c.Update(); //if((c.down & ControlState.Either) != 0) // anyControlDown = true; //if((c.held & ControlState.Either) != 0) // anyControlHeld = true; //if((c.up & ControlState.Either) != 0) // anyControlUp = true; } }
public SimpleDataView(Control c) { this.identifier = c.identifier; if(c is ActionControl) { var ac = c as ActionControl; this.bindings = ac.bindings.Select(b => b.Key).ToArray(); this.modifiers = ac.bindings.Values.ToArray(); } else if(c is AxisControl) { var ax = c as AxisControl; this.bindings = ax.bindings.Select(b => b.Key).ToArray(); } }