public void keyPress(keyTracker kt) { if (kt.is_KeyDown) { if (kt.value_keyAxis < 0.0f) { f_bearing = -1.0f; } else { if (kt.value_keyAxis > 0.0f) { f_bearing = 1.0f; } else { f_bearing = 0.0f; } } curVel += kt.value_keyAxis + (f_bearing * minVel); //Multiply by the scroll speed scroll bar speed multiplier curVel *= ConfigHandler.instance.ConfigData.m_panSpeed_FB; //clamp to max velocity curVel = (Mathf.Min(Mathf.Abs(curVel), maxVel)) * f_bearing; time_remaining = time_totalscrolltime; } }
public void keyPress(keyTracker kt) { if(kt.is_KeyDown) { if(kt.value_keyAxis < 0.0f) { f_bearing = -1.0f; } else { if(kt.value_keyAxis > 0.0f) { f_bearing = 1.0f; } else { f_bearing = 0.0f; } } curVel += kt.value_keyAxis + (f_bearing * minVel); //Multiply by the scroll speed scroll bar speed multiplier curVel *= ConfigHandler.instance.ConfigData.m_panSpeed_FB; //clamp to max velocity curVel = (Mathf.Min(Mathf.Abs(curVel), maxVel)) * f_bearing; time_remaining = time_totalscrolltime; } }
public void Scroll_keyPress(keyTracker kt) { if(kt.is_KeyDown) { if(kt.value_keyAxis < 0.0f) { direction = -1.0f; } else { if(kt.value_keyAxis > 0.0f) { direction = 1.0f; } else { direction = 0.0f; } } curVel += kt.value_keyAxis + (direction * minVel); //Multiply by the scroll speed scroll bar speed multiplier curVel *= ConfigHandler.instance.ConfigData.m_zoomSpeed; //clamp to max velocity curVel = (Mathf.Min(Mathf.Abs(curVel), maxVel)) * direction; time_remaining = time_totalscrolltime; } }
public void Scroll_keyPress(keyTracker kt) { if (kt.is_KeyDown) { if (kt.value_keyAxis < 0.0f) { direction = -1.0f; } else { if (kt.value_keyAxis > 0.0f) { direction = 1.0f; } else { direction = 0.0f; } } curVel += kt.value_keyAxis + (direction * minVel); //Multiply by the scroll speed scroll bar speed multiplier curVel *= ConfigHandler.instance.ConfigData.m_zoomSpeed; //clamp to max velocity curVel = (Mathf.Min(Mathf.Abs(curVel), maxVel)) * direction; time_remaining = time_totalscrolltime; } }
public void DevMenu_keyPress(keyTracker kt_esc) { if (kt_esc.is_FirstFrame) { Sounds.instance.Play(SoundType.Click); menu_Dev.ToggleMenu(); } }
public void Building_keyPress(keyTracker kt) { if (kt.is_FirstFrame) { Sounds.instance.Play(SoundType.Click); menu_Building.ToggleMenu(); } }
//If they press esc, cancel build mode public void keyPress(keyTracker kt) { if(kt.is_FirstFrame) { if(Buildings.instance.buildInGame.isOn) { Buildings.instance.StopBuildingPurchase(); } } }
//If they press esc, cancel build mode public void keyPress(keyTracker kt) { if (kt.is_FirstFrame) { if (Buildings.instance.buildInGame.isOn) { Buildings.instance.StopBuildingPurchase(); } } }
//HOTKEY - from messageKit public void hotkeyPress(keyTracker kt) { //If they press the hotkey for this button, treat same as click of the building button if (kt.is_FirstFrame) { if (this.isActiveAndEnabled) { BeginBuildingPurchase(); } } }
public keyTracker(string newKeyName) { self = this; //Initialize everything _do_process = false; _is_KeyDown = false; _is_FirstFrame = false; _dura_KeyPress = 0f; _value_keyAxis = 0f; _s_KeyName = newKeyName; }
public keyTracker(string newKeyName, int newMsg, float axisInput) { self = this; //Initialize everything _do_process = false; _is_KeyDown = false; _is_FirstFrame = false; _dura_KeyPress = 0f; _value_keyAxis = axisInput; _s_KeyName = newKeyName; _keyMsg = newMsg; }
/////////////////////////////////// /// Key Input tracking - checks if the shift key is held down public void ShiftKey_keyPress(keyTracker kt) { if (kt.is_KeyDown) { buildInGame.keepOn = true; } else { //Key has been released buildInGame.keepOn = false; } }
void ProcessKey(int keyMsg, ref keyTracker kt) { if(kt.is_KeyDown) { //Key has been held between multiple fixed updates, increment time kt.HeldDown(); } else { //New key press, reinit kt.NewPress(); } //POST the message for any other scripts subscribed to this message type MessageKit<keyTracker>.post( keyMsg, kt ); }
void ProcessKey(int keyMsg, ref keyTracker kt) { if (kt.is_KeyDown) { //Key has been held between multiple fixed updates, increment time kt.HeldDown(); } else { //New key press, reinit kt.NewPress(); } //POST the message for any other scripts subscribed to this message type MessageKit <keyTracker> .post(keyMsg, kt); }