Ejemplo n.º 1
0
    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;
        }
    }
Ejemplo n.º 2
0
    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;
        }
    }
Ejemplo n.º 3
0
    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;
        }
    }
Ejemplo n.º 4
0
    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;
        }
    }
Ejemplo n.º 5
0
    public void DevMenu_keyPress(keyTracker kt_esc)
    {
        if (kt_esc.is_FirstFrame)
        {
            Sounds.instance.Play(SoundType.Click);

            menu_Dev.ToggleMenu();
        }
    }
Ejemplo n.º 6
0
    public void Building_keyPress(keyTracker kt)
    {
        if (kt.is_FirstFrame)
        {
            Sounds.instance.Play(SoundType.Click);

            menu_Building.ToggleMenu();
        }
    }
Ejemplo n.º 7
0
 //If they press esc, cancel build mode
 public void keyPress(keyTracker kt)
 {
     if(kt.is_FirstFrame)
     {
         if(Buildings.instance.buildInGame.isOn)
         {
             Buildings.instance.StopBuildingPurchase();
         }
     }
 }
Ejemplo n.º 8
0
 //If they press esc, cancel build mode
 public void keyPress(keyTracker kt)
 {
     if (kt.is_FirstFrame)
     {
         if (Buildings.instance.buildInGame.isOn)
         {
             Buildings.instance.StopBuildingPurchase();
         }
     }
 }
Ejemplo n.º 9
0
 //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();
         }
     }
 }
Ejemplo n.º 10
0
    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;
    }
Ejemplo n.º 11
0
    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;
    }
Ejemplo n.º 12
0
    ///////////////////////////////////

    /// 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;
        }
    }
Ejemplo n.º 13
0
    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 );
    }
Ejemplo n.º 14
0
    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);
    }
Ejemplo n.º 15
0
    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;
    }
Ejemplo n.º 16
0
    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;
    }