public void sv_Share() { timekeeper tk = scriptbox.GetComponent <timekeeper>();//スコアを取得 string text = "サバイバルモードでLv「" + tk.sv_phase + "」に到達した!\n新感覚三角パズルアクション・フリクタル\n#Flictal "; string URL = "https://play.google.com/store/apps/details?id=com.KMpro.Flictal"; SocialConnector.SocialConnector.Share(text, URL); // SocialConnector.SocialConnector.Share(en.jikiname); }
// Update is called once per frame public void Resume() { timekeeper tk = scriptbox.GetComponent <timekeeper>(); tk.flag = true; running = true; stopbutton.SetActive(true); resumubutton.SetActive(false); pausetriangle.SetActive(false); }
public void restartbutton() { ScoreHolder sh = scriptbox.GetComponent <ScoreHolder>(); timekeeper tk = scriptbox.GetComponent <timekeeper>(); resultmenu.SetActive(false); RestartButton.SetActive(false); sh.left_jiki++; tk.flag = true; tk.deadonce = true; }
public void miss() { ImportantValue dx = scriptbox.GetComponent <ImportantValue>(); //スコアを取得 timekeeper tk = scriptbox.GetComponent <timekeeper>(); //スコアを取得 score = score - tk.nowlevel; GameObject score_UI = GameObject.Instantiate(scoreUI) as GameObject; score_UI.transform.parent = canvas.transform; score_UI.GetComponent <RectTransform>().localPosition = new Vector3(-380, 200, 0); ScoreUI ui = score_UI.GetComponent <ScoreUI>();//スコアを取得 ui.hyojiscore = tk.nowlevel; ui.type = 1; }
public void Shrinkmiss() { ImportantValue dx = scriptbox.GetComponent <ImportantValue>(); //スコアを取得 timekeeper tk = scriptbox.GetComponent <timekeeper>(); //スコアを取得 score = score - 10; if (scenemover.gamemode() == 0) { GameObject score_UI = GameObject.Instantiate(scoreUI) as GameObject; score_UI.transform.parent = canvas.transform; score_UI.GetComponent <RectTransform>().localPosition = new Vector3(-380, 200, 0); ScoreUI ui = score_UI.GetComponent <ScoreUI>();//スコアを取得 ui.hyojiscore = 10; ui.type = 1; } }
public void Escape_clicked() { timekeeper tk = scriptbox.GetComponent <timekeeper>(); //スコアを取得 SE_container se = scriptbox.GetComponent <SE_container>(); //スコアを取得 if (scenemover.gamemode() == 0) //中央ボタンはでサバモードでは機能しない { if (tk.flag3 == 2 && tk.flagX3 == 0) { tk.flagX3 = 1; tk.flagX2 = 1; tk.flagX1 = 1; tk.LASTflag = 1; GetComponent <AudioSource>().PlayOneShot(se.EScape);//効果音を鳴らす EScapeflag = true; } } }
public bool firstmove(int goal) { SE_container se = scriptbox.GetComponent <SE_container>();//スコアを取得 timekeeper tk = scriptbox.GetComponent <timekeeper>(); var uptri = new Vector3(0, 0.25f, -5); if (goal == 0)//正解 { rectTran.DOLocalMove(uptri, 0.1f); rectTran.DOScale(0.5f, 0.1f); // GetComponent<AudioSource>().PlayOneShot(se.atari);//効果音を鳴らす move(0); return(true); } else { return(false); } }
public void Update() //三角形の表示 { ImportantValue dx = scriptbox.GetComponent <ImportantValue>(); //スコアを取得 ScoreHolder sh = scriptbox.GetComponent <ScoreHolder>(); //スコアを取得 timekeeper tk = scriptbox.GetComponent <timekeeper>(); //スコアを取得 if (EScapeflag == false) { if (scenemover.gamemode() == 0) { charge.transform.localScale = new Vector3((float)sh.combo % dx.addcombo2 / dx.addcombo2, (float)sh.combo % dx.addcombo2 / dx.addcombo2, (float)sh.combo % dx.addcombo2 / dx.addcombo2); if (tk.time_lv4 < 6) { chargeesc.SetActive(true); if (toriaezuflag == false) { tenmetu(); toriaezuflag = true; } } } else//サバイバル時 { charge.transform.localScale = new Vector3((float)sh.sv_progress % dx.sv_progress_per_level / dx.sv_progress_per_level, (float)sh.sv_progress % dx.sv_progress_per_level / dx.sv_progress_per_level, (float)sh.sv_progress % dx.sv_progress_per_level / dx.sv_progress_per_level); } } else { charge.SetActive(false); chargeesc.SetActive(false); chargeescaping.SetActive(true); } if (tk.LASTflag == 2) { chargeescaping.SetActive(false);; } }
void Update() { ScoreHolder d1 = scriptbox.GetComponent <ScoreHolder>(); timekeeper tk = scriptbox.GetComponent <timekeeper>();//スコアを取得 if (scenemover.gamemode() == 0) { if (tk.LASTflag == 2) { ResultTitleText.text = ("ゲームクリア!!"); lefttime.SetActive(true); failinfo.SetActive(false); lefttimeText.text = (tk.lefttime.ToString("##.##") + "秒"); } else { ResultTitleText.text = ("時間切れ…"); lefttime.SetActive(false); failinfo.SetActive(true); } this.targetText.text = (d1.score + ""); targetText_r.text = (d1.score + ""); comboText.text = (d1.combo + " "); MaxcomboText.text = (d1.maxcombo + " "); } else if (scenemover.gamemode() == 1)//サバイバル { ResultTitleText.text = ("ゲーム終了"); lefttime.SetActive(false); failinfo.SetActive(true); this.targetText.text = (tk.sv_phase + ""); targetText_r.text = (tk.sv_phase + ""); comboText.text = (d1.left_jiki + " "); MaxcomboText.text = (tk.sv_phase * 30 + " "); } }
public void interval() { ImportantValue dx = scriptbox.GetComponent <ImportantValue>(); //スコアを取得 timekeeper tk = scriptbox.GetComponent <timekeeper>(); //スコアを取得 int bonus_s; int bonus_c; switch (tk.nowlevel) { case 1: break; case 2: bonus_s = (int)(score * dx.timebonus_score_lv1); scorebonus_t.text = ("+" + bonus_s + "秒"); tk.time_lv2 = tk.time_lv2 + bonus_s; scorebefore = score; break; case 3: bonus_s = (int)((score - scorebefore) * dx.timebonus_score_lv2); scorebonus_t.text = ("+" + bonus_s + "秒"); tk.time_lv3 = tk.time_lv3 + bonus_s; scorebefore = score; break; case 4: bonus_s = (int)((score - scorebefore) * dx.timebonus_score_lv3); scorebonus_t.text = ("+" + bonus_s + "秒"); tk.time_lv4 = tk.time_lv4 + bonus_s; scorebefore = score; break; } }
public void comboadd() { ImportantValue dx = scriptbox.GetComponent <ImportantValue>(); timekeeper tk = scriptbox.GetComponent <timekeeper>(); SE_container se = scriptbox.GetComponent <SE_container>();// if (scenemover.gamemode() == 0) { combo++; if (maxcombo < combo) { maxcombo = combo; } int plusscore = 0; switch (tk.nowlevel) { case 1: if (combo < dx.combobonus_lv1) { plusscore = combo; } else { plusscore = dx.combobonus_lv1; } break; case 2: if (combo * 2 < dx.combobonus_lv2) { plusscore = combo * 2; } else { plusscore = dx.combobonus_lv2; } break; case 3: if (combo * 3 < dx.combobonus_lv3) { plusscore = combo * 3; } else { plusscore = dx.combobonus_lv3; } break; case 4: if (combo * 4 < dx.combobonus_lv4) { plusscore = combo * 4; } else { plusscore = dx.combobonus_lv4; } break; } // tk.time = tk.time + dx.addtime1; score = score + plusscore; GameObject score_UI = GameObject.Instantiate(scoreUI) as GameObject; score_UI.transform.SetParent(canvas.transform); score_UI.GetComponent <RectTransform>().localPosition = new Vector3(-380, 200, 0); ScoreUI ui = score_UI.GetComponent <ScoreUI>();//スコアを取得 ui.hyojiscore = plusscore; //時間延長工作 if (combo % dx.addcombo1 == 0 && (combo % dx.addcombo2 != 0)) //5コンボごとに時間追加 { GetComponent <AudioSource>().PlayOneShot(se.Fivecombo); //効果音を鳴らす switch (tk.nowlevel) { case 1: tk.time_lv1 = tk.time_lv1 + dx.addtime1; break; case 2: tk.time_lv2 = tk.time_lv2 + dx.addtime1; break; case 3: tk.time_lv3 = tk.time_lv3 + dx.addtime1; break; case 4: tk.time_lv4 = tk.time_lv4 + dx.addtime1; break; } // tk.time = tk.time + dx.addtime1; } if (combo % dx.addcombo2 == 0) //10コンボごとに時間追加 { GetComponent <AudioSource>().PlayOneShot(se.Tencombo); //効果音を鳴らす switch (tk.nowlevel) { case 1: tk.time_lv1 = tk.time_lv1 + dx.addtime2; break; case 2: tk.time_lv2 = tk.time_lv2 + dx.addtime2; break; case 3: tk.time_lv3 = tk.time_lv3 + dx.addtime2; break; case 4: tk.time_lv4 = tk.time_lv4 + dx.addtime2; break; } tk.time = tk.time + dx.addtime2; } } //ここからサバイバル //ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss else if (scenemover.gamemode() == 1) { progress++; if (progress == dx.sv_progress_per_level) //5コンボごとに時間追加 { GetComponent <AudioSource>().PlayOneShot(se.Fivecombo); //効果音を鳴らす switch (tk.nowlevel) { case 1: tk.flag1 = 1; break; case 2: tk.flag2 = 1; break; case 3: tk.flag3 = 1; break; case 4: tk.flagX3 = 1; tk.flagX2 = 1; tk.flagX1 = 1; break; } progress = 0; // tk.time = tk.time + dx.addtime1; } } }
// フリックジェスチャーが成功すると呼ばれるメソッド private void OnFlick(object sender, System.EventArgs e) { timekeeper dt = scriptbox.GetComponent <timekeeper>(); ImportantValue iv = scriptbox.GetComponent <ImportantValue>(); ScoreHolder sh = scriptbox.GetComponent <ScoreHolder>(); stop st = scriptbox.GetComponent <stop>(); if (dt.time == 0 && scenemover.gamemode() == 0) { return; } if (dt.time_lv4 <= 0 && scenemover.gamemode() == 0) { return; } if (dt.coolflag == true && scenemover.gamemode() == 0) { return; } if (dt.time_sv <= 0 && scenemover.gamemode() == 1) { return; } if (sh.left_jiki < 0 && scenemover.gamemode() == 1) { return; } if (st.running == false) { return; } ScoreHolder d_score = scriptbox.GetComponent <ScoreHolder>(); var up = new Vector3(0, 1, 0); //上 var left = new Vector3(-0.866f, -0.5f, 0); //左下 var right = new Vector3(0.866f, -0.5f, 0); //右上 var gesture = sender as FlickGesture; // string str = "フリック: " + gesture.ScreenFlickVector + " (" + gesture.ScreenFlickTime + "秒)"; var Fvector = gesture.ScreenFlickVector.normalized; // Vector3.Dot(Fvector, uptri); //$$遊び switch (iv.jiki) { case 30: zentai.transform.DOShakePosition(0.2f, 1, 10, 90, false, true); break; case 31: zentai.transform.DOShakePosition(1f, 10, 100, 90, false, true); break; } if (Vector3.Dot(Fvector, up) > 0.5f) { goal = 0; } if (Vector3.Dot(Fvector, left) > 0.5f) { goal = 1; } if (Vector3.Dot(Fvector, right) > 0.5f) { goal = 2; } Flicked f0 = scriptbox.GetComponent <Flicked>(); Flicked_1 f1 = scriptbox.GetComponent <Flicked_1>(); Flicked_2 f2 = scriptbox.GetComponent <Flicked_2>(); Flicked_3 f3 = scriptbox.GetComponent <Flicked_3>(); Shrink_3 s3 = scriptbox.GetComponent <Shrink_3>(); shrink_2 s2 = scriptbox.GetComponent <shrink_2>(); shrink_1 s1 = scriptbox.GetComponent <shrink_1>(); shrink_0 s0 = scriptbox.GetComponent <shrink_0>(); if (dt.nowlevel == 0)//ホントに最初 { if (f0.firstmove(goal)) { dt.flag = true; dt.nowlevel = 1; } } else if (dt.flag1 == 0)//最初 { f0.move(goal); } else if (dt.flag1 == 1) { if (f1.firstmove(goal)) { dt.flag1 = 2; } dt.flag = true; } else if (dt.flag2 == 0) { f1.move(goal); } else if (dt.flag2 == 1) { if (f2.firstmove(goal)) { dt.flag2 = 2; } dt.flag = true; } else if (dt.flag3 == 0) { f2.move(goal); } else if (dt.flag3 == 1) { if (f3.firstmove(goal)) { dt.flag3 = 2; } dt.flag = true; } else if (dt.flagX3 == 0) { f3.move(goal); } else if (dt.flagX3 == 1) { if (s3.shrink(goal)) { dt.flagX3 = 2; } } else if (dt.flagX2 == 1) { if (s2.shrink(goal)) { dt.flagX2 = 2; } } else if (dt.flagX1 == 1) { if (s1.shrink(goal)) { dt.flagX1 = 2; } } else if (dt.LASTflag == 1) { if (s0.shrink(goal)) { dt.LASTflag = 2; } } else { // Debug.Log("もうねえ"); } int var; //nextlevel()で全部0に戻される }