// Use this for initialization void Start() { if (sheep == null) { sheep = GameObject.Find("sheep"); } if (setting == null) { setting = GameObject.Find("background"); } if (title_logo == null) { setting = GameObject.Find("Title_Logo"); } if (Select == null) { Select = title_logo; } hJoyStickReceiver jsr = new hJoyStickReceiver(); hKeyConfig.Config["Jump"] = jsr.GetPlayBtn(hJoyStickReceiver.PlayStationContoller.Cross); hKeyConfig.Config["Zone"] = jsr.GetPlayBtn(hJoyStickReceiver.PlayStationContoller.L1); hKeyConfig.Config["Submit"] = jsr.GetPlayBtn(hJoyStickReceiver.PlayStationContoller.Square); }
// Use this for initialization void Start() { // 子オブジェクトの取得 _child = transform.FindChild("humer").gameObject; jsr = new hJoyStickReceiver(); kcs = new hKeyConfigSettings(); kcs.Init(); }
// 初期化 public void Init() { try { #if UNITY_EDITOR FilePath = Application.dataPath + "/Scenes/hayase/" + Application.unityVersion + ".txt"; #else FilePath = Application.dataPath + "/" + Application.unityVersion + ".txt"; #endif jsr = new hJoyStickReceiver(); // ファイルからキー状態の設定を読み込む FileStream fs = new FileStream(FilePath, FileMode.OpenOrCreate); StreamReader sr = new StreamReader(fs); ArrayList ar = new ArrayList(); string s; while ((s = sr.ReadLine()) != null) { ar.Add(s); } // 閉じ sr.Close(); fs.Close(); if (ar.Count == 0) { // ファイルが有っても中身が無いときのとりあえず入れとくやつ hKeyConfig.Config["Jump"] = jsr.GetPlayBtn(hJoyStickReceiver.PlayStationContoller.Cross); hKeyConfig.Config["Zone"] = jsr.GetPlayBtn(hJoyStickReceiver.PlayStationContoller.L1); mo = 0; ParallaxEffect = true; } else { // 設定する hKeyConfig.Config["Jump"] = ar[0].ToString(); hKeyConfig.Config["Zone"] = ar[1].ToString(); mo = int.Parse(ar[2].ToString()); ParallaxEffect = bool.Parse(ar[3].ToString()); } } catch (IOException e) { Debug.Log(e.Message + "エラー"); // エラー出たらとりあえず入れる hKeyConfig.Config["Jump"] = jsr.GetPlayBtn(hJoyStickReceiver.PlayStationContoller.Cross); hKeyConfig.Config["Zone"] = jsr.GetPlayBtn(hJoyStickReceiver.PlayStationContoller.L1); } // デバック用の表示 Debug.LogWarning("JumpButton: " + hKeyConfig.Config["Jump"] + ", ZoneButton: " + hKeyConfig.Config["Zone"]); hKeyConfig.Config["Home"] = jsr.GetPlayBtn(hJoyStickReceiver.PlayStationContoller.PSButton); hKeyConfig.Config["Submit"] = jsr.GetPlayBtn(JoyStick_Submit); SetDisp("JumpBtn", hKeyConfig.Config["Jump"]); SetDisp("ZoneBtn", hKeyConfig.Config["Zone"]); }
// Use this for initialization void Start() { // 子オブジェクトの取得 _child = transform.FindChild("humer").gameObject; if (pChildren == null) { pChildren = GameObject.Find("player"); } pChildColor = pChildren.GetComponent <SpriteRenderer>().color; jsr = new hJoyStickReceiver(); kcs = new hKeyConfigSettings(); kcs.Init(); if (yhp == null) { yhp = new yHpgage(); } //yhp.Acquisition(); }