/// <summary> /// 月夜の竹取(かぐや姫) /// </summary> public void MoonlightBambooTaking() { bool loopFirst = true; int loopCnt = 0; Drop.DROPTYPE DropType = Drop.DROPTYPE.MAX; foreach (var item in DropList) { if (loopFirst) { DropType = item.GetComponent <Drop>()._DropType; loopFirst = false; } else { if (item.GetComponent <Drop>()._DropType != DropType) { Vector3 Position = item.transform.position; //Destroy(item); Create(DropType, loopCnt, Drop.Abnormality.Normal); // NewDrop.transform.position = Position; } } loopCnt++; } }
///// <summary> ///// 全てのレーンのドロップを一段落とす ///// </summary> //public void AllDropDown() //{ // for (int i = 0; i < MAX_RANE; i++) // { // DropRaneList[i].GetComponent<DropRane>().AllDropDown(); // } //} /// <summary> /// 全てのレーンのターゲットドロップが同じ種類なら全削除する /// </summary> /// <returns>全削除したかどうか</returns> public bool IfNeeded() { Drop.DROPTYPE droptype = DropRaneList[(int)DropRane.LANEKIND.LANE1].GetComponent <DropRane>()._TargetDrop; Drop.DROPTYPE _droptype; for (int i = 0; i < MAX_RANE; i++) { _droptype = DropRaneList[i].GetComponent <DropRane>()._TargetDrop; if (droptype != _droptype) { break; } else { //全て同じドロップなら if (i == MAX_RANE - 1) { //全てのターゲットドロップ削除 for (int j = 0; j < MAX_RANE; j++) { DropRaneList[j].GetComponent <DropRane>().TargetDelete(); } return(true); } } droptype = _droptype; } return(false); }
// Update is called once per frame void Update() { Drop.DROPTYPE cnt = (Drop.DROPTYPE) 0; PushBotton = Drop.DROPTYPE.MAX; foreach (var list in BottonList) { if (list.GetComponent <Botton>()._IsCollision) { if (cnt == Drop.DROPTYPE.Circle) { PushBotton = Drop.DROPTYPE.Circle; TouchCnt++; } else if (cnt == Drop.DROPTYPE.Cross) { PushBotton = Drop.DROPTYPE.Cross; TouchCnt++; } else if (cnt == Drop.DROPTYPE.Tryangle) { PushBotton = Drop.DROPTYPE.Tryangle; TouchCnt++; } } cnt++; } }
/// <summary> /// 指定されたドロップの種類に応じてプレハブ生成 /// </summary> /// <param name="droptype">ドロップの種類</param> /// <returns>ドロップのGameObject</returns> public GameObject DropCreate(Drop.DROPTYPE droptype) { GameObject DropPrefab; switch (droptype) { case Drop.DROPTYPE.Circle: DropPrefab = Instantiate(CircleDropPrefab); DropPrefab.GetComponent <Drop>()._DropType = droptype; return(DropPrefab); case Drop.DROPTYPE.Cross: DropPrefab = Instantiate(CrossDropPrefab); DropPrefab.GetComponent <Drop>()._DropType = droptype; return(DropPrefab); case Drop.DROPTYPE.Tryangle: DropPrefab = Instantiate(TryangleDropPrefab); DropPrefab.GetComponent <Drop>()._DropType = droptype; return(DropPrefab); default: return(null); } }
/// <summary> /// ターゲットのドロップが引数と同じ種類なら削除 /// </summary> /// <param name="droptype"></param> /// <returns>成功か失敗か</returns> public bool TargetDelete(Drop.DROPTYPE droptype) { Drop.DROPTYPE DropType = DropList[(int)DropNumber.FIRST].GetComponent <Drop>()._DropType; Drop.Abnormality Abnormality = DropList[(int)DropNumber.FIRST].GetComponent <Drop>()._Abnormality; if ((DropType == droptype) || (DropType == Drop.DROPTYPE.Rainbow) && (Abnormality != Drop.Abnormality.Rebellion)) { TargetDelete(); return(true); } else if ((DropType == droptype) || (DropType == Drop.DROPTYPE.Rainbow)) { if (Abnormality == Drop.Abnormality.Rebellion) { if (DropList[(int)DropNumber.FIRST].GetComponent <RebellionDrop>()._DisplayNumber == 0) { TargetDelete(); return(true); } else { DropList[(int)DropNumber.FIRST].GetComponent <RebellionDrop>()._DisplayNumber--; } } } return(false); }
/// <summary> /// 初期化処理 /// </summary> /// <param name="lanekind">このレーンの種類</param> /// <param name="droptype">ドロップの種類</param> public void Init(LANEKIND lanekind, Drop.DROPTYPE droptype) { ButtlegameObject = GameObject.Find("ButtleManager"); //レーンを保存 LaneKind = lanekind; Vector2 Pos = TargetPosition; Pos.x += (float)lanekind * INTERVAL_SIZE.x; for (int i = 0; i < MAX_DROP; i++) { GameObject inst; if (i == 0) { inst = Create(droptype, Drop.Abnormality.Normal); } else { inst = Create(Drop.Abnormality.Normal); } //座標設定 inst.transform.position = new Vector3(Pos.x, Pos.y, INTERVAL_SIZE.z * i); Pos.y += INTERVAL_SIZE.y; } }
/// <summary> /// 指定されたドロップの種類に応じてプレハブ生成 /// </summary> /// <param name="droptype">ドロップの種類</param> /// <returns>ドロップのGameObject</returns> //public GameObject RestraintDropCreate(Drop.DROPTYPE droptype) //{ // GameObject DropPrefab; // switch (droptype) // { // case Drop.DROPTYPE.Circle: // DropPrefab = Instantiate(CircleRestraintDrop); // DropPrefab.GetComponent<Drop>()._DropType = droptype; // return DropPrefab; // case Drop.DROPTYPE.Cross: // DropPrefab = Instantiate(CrossRestraintDrop); // DropPrefab.GetComponent<Drop>()._DropType = droptype; // return DropPrefab; // case Drop.DROPTYPE.Tryangle: // DropPrefab = Instantiate(TryangleRestraintDrop); // DropPrefab.GetComponent<Drop>()._DropType = droptype; // return DropPrefab; // default: // return null; // } //} /// <summary> /// ターゲットドロップの種類が一致しているか調べる /// </summary> /// <param name="droptype">一致しているか調べる種類</param> /// <returns>一致しているかどうか</returns> public bool TargetDropSearch(Drop.DROPTYPE droptype) { if (DropList[(int)DropNumber.FIRST].GetComponent <Drop>()._DropType == droptype) { return(true); } return(false); }
/// <summary> /// 指定したドロップを生成するメゾットを呼びだしリストに格納 /// </summary> /// <param name="droptype">ドロップの種類</param> /// <returns>ドロップのGameObject</returns> public GameObject Create(Drop.DROPTYPE droptype) { GameObject inst; inst = DropCreate(droptype); inst.transform.Translate(TargetPosition.x + (float)LaneKind * INTERVAL_SIZE.x, TargetPosition.y + INTERVAL_SIZE.y * (MAX_DROP - 1), transform.position.z); DropList.Add(inst); return(inst); }
// Use this for initialization void Start() { //各ボタンの生成 CircleBotton = Instantiate(CircleBotton); BottonList.Add(CircleBotton); CrossBotton = Instantiate(CrossBotton); BottonList.Add(CrossBotton); TryangleBotton = Instantiate(TryangleBotton); BottonList.Add(TryangleBotton); PushBotton = Drop.DROPTYPE.MAX; }
/// <summary> /// 指定したドロップを生成するメゾットを呼びだしリストに格納 /// </summary> /// <param name="droptype">ドロップの種類</param> /// <returns>ドロップのGameObject</returns> public GameObject Create(Drop.DROPTYPE droptype, Drop.Abnormality Abnormality) { GameObject inst; inst = DropCreate(droptype, Abnormality); //Vector3 position = inst.transform.position; Vector3 position = new Vector3(TargetPosition.x + (float)LaneKind * INTERVAL_SIZE.x, TargetPosition.y + INTERVAL_SIZE.y * (MAX_DROP - 1), transform.position.z); //position *= 25; inst.transform.position = position; DropList.Add(inst); return(inst); }
/// <summary> /// 指定したドロップを生成するメゾットを呼びだしリストの指定した要素に格納 /// </summary> /// <param name="droptype">ドロップの種類</param> /// <returns>ドロップのGameObject</returns> public GameObject Create(Drop.DROPTYPE droptype, int ListNumber, Drop.Abnormality Abnormality) { GameObject inst; Vector3 position = DropList[ListNumber].GetComponent <Drop>().transform.position; Destroy(DropList[ListNumber].gameObject); // DropList.Remove(DropList[ListNumber]); inst = DropCreate(droptype, Abnormality); //Vector3 position = new Vector3(TargetPosition.x + (float)LaneKind * INTERVAL_SIZE.x, TargetPosition.y + INTERVAL_SIZE.y * (MAX_DROP - ListNumber - 1), transform.position.z); //position *= 25; inst.GetComponent <Drop>().transform.position = position; DropList[ListNumber] = inst; return(inst); }
/// <summary> /// 全てのレーンはターゲットドロップが引数と同じ種類なら削除 /// </summary> /// <param name="droptype"></param> /// <returns>成功した回数</returns> public int TargetSearch(Drop.DROPTYPE droptype) { //成功した回数 int success = 0; foreach (var list in DropRaneList) { if (list.GetComponent <DropRane>().TargetDropSearch(droptype)) { success++; } } return(success); }
/// <summary> /// 全てのレーンのターゲットドロップが同じ種類なら全削除する /// </summary> /// <returns>全削除したドロップ種類</returns> public IfNeededData IfNeeded() { IfNeededData IfNeededData; Drop.DROPTYPE droptype = Drop.DROPTYPE.MAX; foreach (var list in DropRaneList) { droptype = list.GetComponent <DropRane>()._TargetDrop; if (droptype != Drop.DROPTYPE.Rainbow) { break; } } // Drop.DROPTYPE droptype = DropRaneList[(int)DropRane.LANEKIND.LANE1].GetComponent<DropRane>()._TargetDrop; Drop.DROPTYPE _droptype; for (int i = 0; i < MAX_RANE; i++) { _droptype = DropRaneList[i].GetComponent <DropRane>()._TargetDrop; if ((droptype == _droptype) || (_droptype == Drop.DROPTYPE.Rainbow)) { //全て同じドロップなら if (i == MAX_RANE - 1) { //全てのターゲットドロップ削除 for (int j = 0; j < MAX_RANE; j++) { DropRaneList[j].GetComponent <DropRane>().TargetDelete(); } IfNeededData.MooveFlag = DropRaneList[(int)DropRane.DropNumber.FIRST].GetComponent <DropRane>()._MoveFlag; IfNeededData.Droptype = droptype; return(IfNeededData); } } else { break; } } IfNeededData.MooveFlag = false; IfNeededData.Droptype = Drop.DROPTYPE.MAX; return(IfNeededData); }
/// <summary> /// 初期化処理 /// </summary> public void Init() { for (int i = 0; i < MAX_RANE; i++) { //前回のドロップ種類 Drop.DROPTYPE OldDropType = Drop.DROPTYPE.MAX; Drop.DROPTYPE DropType = Drop.DROPTYPE.MAX; while (OldDropType == DropType) { DropType = ((Drop.DROPTYPE)Random.Range((float)Drop.DROPTYPE.Circle, (float)Drop.DROPTYPE.Tryangle + 1)); } GameObject inst; inst = Instantiate(DropRanePrefab); DropRaneList.Add(inst); DropRaneList[i].GetComponent <DropRane>().Init((DropRane.LANEKIND)i, DropType); OldDropType = DropType; } }
/// <summary> /// 全てのレーンはターゲットドロップが引数と同じ種類なら削除 /// </summary> /// <param name="droptype"></param> /// <returns>成功した回数</returns> public int TargetDelete(Drop.DROPTYPE droptype) { //成功した回数 int successTimes = 0; bool IsSuccess; for (int i = 0; i < MAX_RANE; i++) { IsSuccess = DropRaneList[i].GetComponent <DropRane>().TargetDelete(droptype); if (IsSuccess) { successTimes++; } IsSuccess = false; } return(successTimes); }
public override float HitDamage(int attack, Drop.DROPTYPE droptype) { if (droptype == Drop.DROPTYPE.Circle) { _HP -= attack; } else if (droptype == Drop.DROPTYPE.Cross) { _HP -= (int)((float)attack * 1.5f); } else { _HP -= (int)((float)attack * 0.5f); } if (_HP < 0) { _HP = 0; } return(SetHp()); }
public override void Execute(ButtleManager buttlemanager) { GameObject bottan = GameObject.Find("BottonManager"); Drop.DROPTYPE type = bottan.GetComponent <BottonManager>()._PushBotton; if (IsFirst) { //プレイヤ情報を一部リセット buttlemanager._PlayerManager.GetComponent <PlayerManager>().Reset(); //タッチされた回数をリセット buttlemanager._BottanManager.GetComponent <BottonManager>()._TouchCnt = 0; IsFirst = false; } //プレイヤの更新処理呼び出し buttlemanager._PlayerManager.GetComponent <PlayerManager>().IsUpdate(); ////プレイヤが押されたとき状態をドロップ操作へ if (type != Drop.DROPTYPE.MAX) { buttlemanager.ChangeState(DropOperation.GetInstance()); IsFirst = true; } }
/// <summary> /// 初期化処理 /// </summary> /// <param name="lanekind">このレーンの種類</param> /// <param name="droptype">ドロップの種類</param> public void Init(LANEKIND lanekind, Drop.DROPTYPE droptype) { //レーンを保存 LaneKind = lanekind; Vector2 Pos = TargetPosition; Pos.x += (float)lanekind * INTERVAL_SIZE.x; for (int i = 0; i < MAX_DROP; i++) { GameObject inst; if (i == 0) { inst = Create(droptype); } else { inst = Create(); } //座標設定 inst.transform.position = new Vector3(Pos.x, Pos.y, transform.position.z); Pos.y += INTERVAL_SIZE.y; } }
/// <summary> /// HPからダメージをうける /// </summary> /// <param name="damage"></param> public abstract float HitDamage(int damage, Drop.DROPTYPE droptype);
/// <summary> /// 指定されたドロップの種類に応じてプレハブ生成 /// </summary> /// <param name="droptype">ドロップの種類</param> /// <returns>ドロップのGameObject</returns> public GameObject DropCreate(Drop.DROPTYPE droptype, Drop.Abnormality Abnormality) { GameObject DropPrefab = null; switch (droptype) { case Drop.DROPTYPE.Circle: switch (Abnormality) { case Drop.Abnormality.Normal: DropPrefab = Instantiate(CircleDropPrefab); DropPrefab.GetComponent <Drop>()._DropType = droptype; break; case Drop.Abnormality.Restraint: DropPrefab = Instantiate(CircleRestraintDrop); DropPrefab.GetComponent <RestraintDrop>()._DropType = droptype; break; case Drop.Abnormality.Darkness: DropPrefab = Instantiate(DarknessDrop); break; case Drop.Abnormality.Rebellion: DropPrefab = Instantiate(CircleRebellionDrop); break; default: break; } return(DropPrefab); case Drop.DROPTYPE.Cross: switch (Abnormality) { case Drop.Abnormality.Normal: DropPrefab = Instantiate(CrossDropPrefab); DropPrefab.GetComponent <Drop>()._DropType = droptype; break; case Drop.Abnormality.Restraint: DropPrefab = Instantiate(CrossRestraintDrop); DropPrefab.GetComponent <RestraintDrop>()._DropType = droptype; break; case Drop.Abnormality.Darkness: DropPrefab = Instantiate(DarknessDrop); break; case Drop.Abnormality.Rebellion: DropPrefab = Instantiate(CrossRebellionDrop); break; default: break; } return(DropPrefab); case Drop.DROPTYPE.Tryangle: switch (Abnormality) { case Drop.Abnormality.Normal: DropPrefab = Instantiate(TryangleDropPrefab); DropPrefab.GetComponent <Drop>()._DropType = droptype; break; case Drop.Abnormality.Restraint: DropPrefab = Instantiate(TryangleRestraintDrop); DropPrefab.GetComponent <RestraintDrop>()._DropType = droptype; break; case Drop.Abnormality.Darkness: DropPrefab = Instantiate(DarknessDrop); break; case Drop.Abnormality.Rebellion: DropPrefab = Instantiate(TryangleRebellionDrop); break; default: break; } return(DropPrefab); case Drop.DROPTYPE.Rainbow: DropPrefab = Instantiate(RainbowDrop); DropPrefab.GetComponent <Drop>()._DropType = droptype; return(DropPrefab); default: return(null); } }