/// <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> /// <returns>ドロップのGameObject</returns> public GameObject Create(Drop.Abnormality Abnormality) { GameObject inst; inst = DropCreate((Drop.DROPTYPE)Random.Range((float)Drop.DROPTYPE.Circle, (float)Drop.DROPTYPE.Tryangle + 1), Abnormality); inst.transform.Translate(TargetPosition.x + (float)LaneKind * INTERVAL_SIZE.x, TargetPosition.y + INTERVAL_SIZE.y * (MAX_DROP - 1), 0); DropList.Add(inst); return(inst); }
/// <summary> /// ランダムなドロップを生成するメゾットを呼びだしリストの指定した要素に格納 /// </summary> /// <param name="droptype">ドロップの種類</param> /// <returns>ドロップのGameObject</returns> public GameObject Create(int ListNumber, Drop.Abnormality Abnormality) { GameObject inst; Vector3 position = DropList[ListNumber].GetComponent <Drop>().transform.position; Destroy(DropList[ListNumber].gameObject); inst = DropCreate((Drop.DROPTYPE)Random.Range((float)Drop.DROPTYPE.Circle, (float)Drop.DROPTYPE.Tryangle + 1), Abnormality); inst.GetComponent <Drop>().transform.position = position; DropList[ListNumber] = inst; return(inst); }
/// <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>ドロップの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); } }