コード例 #1
0
    // Start is called before the first frame update
    void Start()
    {
        idm = new InputDatabaseManager(Application.dataPath);

        Dictionary <string, KeyCode[]> keymaps = InputManager.GetKeys();

        string saved = "";

        foreach (string key in keymaps.Keys)
        {
            string value1 = keymaps[key][0].ToString();
            string value2 = keymaps[key][1].ToString();

            saved += key + "=" + value1 + "," + value2 + "\n";
            //Debug.Log(key);
            //Debug.Log((KeyCode)System.Enum.Parse(typeof(KeyCode), keymaps[key][0].ToString()));
        }

        idm.WriteLine(saved);
        //Debug.Log(saved);
    }
コード例 #2
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
         return;
     }
     DB = new InputDatabaseManager(Application.dataPath);
     // initialize
     Initialize();
     if (!UseDefaultKey)
     {
         // if database exist
         if (DB.IsDatabaseExist())
         {
             // load setting into variable
             DB.SetUpKeyFromDb();
         }
     }
 }