コード例 #1
0
    void CheckRightClick()
    {
        //Debug.Log("right click");
        Collider theCollider = DoRaycast();

        if (theCollider == null)
        {
            return;
        }

        GameObject shipPart = FindShipPart(theCollider);

        if (shipPart == null)
        {
            return;
        }

        KeybindableComponent kc = shipPart.GetComponent <KeybindableComponent>();

        if (kc == null)
        {
            return;
        }
        //Debug.Log(kc);
        componentKeybindDialog.OpenDialog(kc);
    }
コード例 #2
0
    public void OpenDialog(KeybindableComponent keybindableComponent)
    {
        this.keybindableComponent = keybindableComponent;
        gameObject.SetActive(true);

        transform.Find("Keybind").GetComponent <Text>().text = keybindableComponent.keyCode.ToString();
    }