public void pageback() { if (nowpage != 1) { nowpage--; circlepainter(nowpage); Allzu.DOLocalMove(new Vector3(-1000 * nowpage + 5500, 0, 0), 0.1f); Title_SE se = scriptbox.GetComponent <Title_SE>(); //スコアを取得 GetComponent <AudioSource>().PlayOneShot(se.flick); //効果音を鳴らす } }
// Update is called once per frame public void gotopage(int targetpos) { /* case 1: * Allzu.DOLocalMove(new Vector3(3500,0,0), 0.1f); * nowpage = 1; * break;*/ nowpage = targetpos; circlepainter(nowpage); Allzu.DOLocalMove(new Vector3(-1000 * nowpage + 5500, 0, 0), 0.1f); Title_SE se = scriptbox.GetComponent <Title_SE>(); //スコアを取得 GetComponent <AudioSource>().PlayOneShot(se.flick); //効果音を鳴らす }
public void Start() { if (File.Exists(Application.persistentDataPath + "/data.json")) { json = File.ReadAllText(Application.persistentDataPath + "/data.json");//読み取ってるよ json = encryption.DecryptString(json); } else { #if UNITY_EDITOR json = File.ReadAllText(Application.streamingAssetsPath + "/data_model.json");//読み取ってるよ #elif UNITY_ANDROID WWW reader = new WWW(Application.streamingAssetsPath + "/data_model.json"); while (!reader.isDone) { } json = reader.text; #endif Debug.Log("初回!"); explanation.SetActive(true); } JsonUtility.FromJsonOverwrite(json, sv);//読み取ったのを変換してるよ sv._yobi5++; hidari.text = sv._name; migi.text = sv._yobi1.ToString();//一瞬変えてる json = JsonUtility.ToJson(sv); json = encryption.EncryptString(json); File.WriteAllText(Application.persistentDataPath + "/data.json", json);//結局これでよかった if (jikimat = Resources.Load <Material>("Materials/no" + sv._jiki)) { backsankaku.GetComponent <SpriteRenderer>().material = jikimat; Debug.Log(sv._jiki + "じゃん"); matFound = true; } else { jikispr = Resources.Load <Sprite>("Materials/no" + sv._jiki); backsankaku.GetComponent <SpriteRenderer>().sprite = jikispr; Debug.Log("ないじゃn"); } // backsankaku.GetComponent<SpriteRenderer>().material = Resources.Load<Material>("Materials/no" + sv._jiki); Title_SE se = scriptbox.GetComponent <Title_SE>();//スコアを取得 se.SEswitch(sv._sound); se.BGMswitch(sv._BGM); }
public void OnClick(int triid, bool playable) { if (playable == true) { Debug.Log(triid + "を選択しました!!"); if (jikimat = Resources.Load <Material>("Materials/no" + triid)) { Debug.Log("大丈夫だよね?"); backsankaku.GetComponent <SpriteRenderer>().material = jikimat; backsankaku.GetComponent <SpriteRenderer>().color = Color.white; backsankaku.GetComponent <SpriteRenderer>().sprite = defospr; } else { backsankaku.GetComponent <SpriteRenderer>().material = defomat; jikispr = Resources.Load <Sprite>("Materials/no" + triid); backsankaku.GetComponent <SpriteRenderer>().sprite = jikispr; } // backsankaku.GetComponent<SpriteRenderer>().material = Resources.Load<Material>("Materials/no" + triid); sv._jiki = triid; json = JsonUtility.ToJson(sv); Debug.Log(json); json = encryption.EncryptString(json); File.WriteAllText(Application.persistentDataPath + "/data.json", json); //結局これでよかった Title_SE se = scriptbox.GetComponent <Title_SE>(); //スコアを取得 se.TriSelected(triid); jikiname.text = jd.name[triid]; setumei.text = jd.info[triid]; } else { Debug.Log(triid + "は未開放です…"); switch (triid)//解放基準を書け { case 0: break; } } }