Beispiel #1
0
 void Start()
 {
     textCanvas       = dialogueCanvas.GetComponentInChildren <Button>().GetComponentInChildren <Text>();
     hk               = Hotkeys.loadHotkeys();
     callDialogue     = hk.loadHotkeySpecific(11);
     continueDialogue = hk.loadHotkeySpecific(12);
 }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     hk        = Hotkeys.loadHotkeys();
     keybind   = hk.loadHotkeySpecific(12).ToString();
     text      = GetComponent <Text>();
     text.text = "Press " + keybind + " to Continue";
 }
Beispiel #3
0
    public static HotkeysSettings loadHotkeys()
    {
        string path = Application.persistentDataPath + "/hotkeys";

        if (File.Exists(path))
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream      stream    = new FileStream(path, FileMode.Open);
            HotkeysSettings hk        = formatter.Deserialize(stream) as HotkeysSettings;
            stream.Close();
            return(hk);
        }
        else //file not created yet
        {
            GameObject buttonObj = GameObject.Find("Buttons");
            Transform  buttons   = buttonObj.transform;
            string[]   hotkeys   = new string[buttons.childCount];
            for (int i = 0; i < buttons.childCount; i++)
            {
                Transform but  = buttons.transform.GetChild(i);
                string    txt2 = but.GetComponentInChildren <Text>().text;
                hotkeys[i] = txt2;
            }
            HotkeysSettings hk = new HotkeysSettings(hotkeys, buttons.childCount);
            saveHotkeys(hk);
            return(hk);
        }
    }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     hk        = Hotkeys.loadHotkeys();
     keybind   = hk.loadHotkeySpecific(11).ToString();
     text      = GetComponent <TextMesh>();
     text.text = "Press " + keybind + " to Interact";
 }
Beispiel #5
0
    // 初期化メソッド
    void Start()
    {
        // 自分に設定されているAnimatorコンポーネントを習得する
        this.animator = GetComponent <Animator>();

        // load hotkeys
        hk       = Hotkeys.loadHotkeys();
        keybind1 = hk.loadHotkeySpecific(5);
        keybind2 = hk.loadHotkeySpecific(6);
        keybind3 = hk.loadHotkeySpecific(7);
        keybind4 = hk.loadHotkeySpecific(8);
        up       = hk.loadHotkeySpecific(0);
        down     = hk.loadHotkeySpecific(1);
        left     = hk.loadHotkeySpecific(2);
        right    = hk.loadHotkeySpecific(3);
        dash     = hk.loadHotkeySpecific(10);

        // load attacks
        atk1 = GetComponent <ExampleAttack>();
        atk2 = GetComponent <AttackWithRecoilDamage>();
        atk3 = GetComponent <AttackThatCanHitSelf>();
        atk4 = GetComponent <Shoot>();

        //load movement
        movement = GetComponent <PlayerMovement1>();
    }
Beispiel #6
0
    public static void saveHotkeys(HotkeysSettings hk)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/hotkeys";
        FileStream      stream    = new FileStream(path, FileMode.Create);

        formatter.Serialize(stream, hk);
        stream.Close();
    }
Beispiel #7
0
 void Start()
 {
     hk       = Hotkeys.loadHotkeys();
     attack1  = GetComponent <ExampleAttack>();
     attack2  = GetComponent <AttackWithRecoilDamage>();
     attack3  = GetComponent <AttackThatCanHitSelf>();
     attack4  = GetComponent <Shoot>();
     keybind1 = hk.loadHotkeySpecific(5);
     keybind2 = hk.loadHotkeySpecific(6);
     keybind3 = hk.loadHotkeySpecific(7);
     keybind4 = hk.loadHotkeySpecific(8);
 }
Beispiel #8
0
    void Start()
    {
        hk = loadHotkeys();
        GameObject buttonObj = GameObject.Find("Buttons");
        Transform  buttons   = buttonObj.transform;

        for (int i = 0; i < buttons.childCount; ++i)
        {
            Transform but  = buttons.transform.GetChild(i);
            Text      txt2 = but.GetComponentInChildren <Text>();
            txt2.text = hk.hotkeys[i];
        }
    }
Beispiel #9
0
    // Use this for initialization
    void Start()
    {
        hk    = Hotkeys.loadHotkeys();
        up    = hk.loadHotkeySpecific(0);
        down  = hk.loadHotkeySpecific(1);
        left  = hk.loadHotkeySpecific(2);
        right = hk.loadHotkeySpecific(3);
        dash  = hk.loadHotkeySpecific(10);
        click = hk.loadHotkeySpecific(9);
        //myCharacterController = GetComponent<CharacterController>();
        canMove = true;

        playerAgent       = GetComponent <NavMeshAgent>();
        playerPlane       = new Plane(transform.up, transform.position); // Need plane for raycasting
        lastMousePosition = Vector3.zero;

        playerAgent.speed = moveSpeed;

        is_moving = false;
    }
Beispiel #10
0
        private void SetDefault()
        {
            Main                = new MainViewSettings();
            Translate           = new TranslateSettings();
            Clipboard           = new ClipboardSettings();
            Window              = new WindowSettings();
            AutoTyper           = new AutoTyperSettings();
            CompactView         = new CompactViewSettings();
            EditableCaptureArea = new EditableCaptureAreaSettings();
            CaptureArea         = new CaptureAreaSettings();
            CaptureAreaStyle    = new CaptureAreaStyleSettings();
            MiniOutput          = new MiniOutputSettings();
            Hotkeys             = new HotkeysSettings();
            TargetLanguage      = new TargetLanguageSettings();
            LanguageProfiles    = new LanguageProfilesSettings();
            LanguageFilters     = new LanguageFiltersSettings();
            ServerInfo          = new ServerInfoSettings();
            KeyInfo             = new KeyInfoSettings();

            Main.SetDefault();
            Translate.SetDefault();
            Clipboard.SetDefault();
            Window.SetDefault();
            AutoTyper.SetDefault();
            CompactView.SetDefault();
            EditableCaptureArea.SetDefault();
            CaptureArea.SetDefault();
            CaptureAreaStyle.SetDefault();
            MiniOutput.SetDefault();
            Hotkeys.SetDefault();
            TargetLanguage.SetDefault();
            LanguageProfiles.SetDefault();
            LanguageFilters.SetDefault();
            ServerInfo.SetDefault();
            KeyInfo.SetDefault();
        }
Beispiel #11
0
 // Use this for initialization
 void Start()
 {
     player   = GetComponent <NavMeshAgent>();
     hk       = Hotkeys.loadHotkeys();
     keybind1 = hk.loadHotkeySpecific(9);
 }
Beispiel #12
0
 // Use this for initialization
 //z and x
 void Start()
 {
     cxy      = transform.position - player.position;
     hk       = Hotkeys.loadHotkeys();
     keybind1 = hk.loadHotkeySpecific(4);
 }