/// <summary> /// ボムを増やす /// </summary> public void AddBom(BomType type) { if (counter.IsStart == false) { return; } bomList.Add(type); }
/// <summary> /// ボールを射出する /// </summary> public void ThrowingBall(Vector3 targetPosition, BomType type) { if (throwingObject == null) { return; } Vector3 transformPos = bullet.transform.position; //ノーマルボムの生成 if (type == BomType.normal) { // Ballオブジェクトの生成 ball = Instantiate(throwingObject, transformPos, Quaternion.identity); InsShadow = Instantiate(shadowObject); } //スペシャルボムの生成 else if (type == BomType.special) { ball = Instantiate(throwingObject, transformPos, Quaternion.identity); } //ボムをキングの子オブジェクトで管理 ball.transform.parent = transform; InsShadow.transform.parent = transform; // 射出角度 float angle = throwingAngle; // 射出速度を算出 Vector3 velocity = CalculateVelocity(bullet.transform.position, targetPosition, angle); // 射出 Rigidbody rid = ball.GetComponent <Rigidbody>(); rid.AddForce(velocity * rid.mass, ForceMode.Impulse); }
/// <summary> /// Get all Bill Of Materials. /// </summary> /// <param name="search"></param> /// <param name="userId"></param> /// <param name="bomType"></param> /// <returns></returns> public List <BillOfMaterial> GetAllBillOfMaterial(SearchSortModel search, string userId, BomType bomType = BomType.Bom) { var query = from bom in Query where bom.Type == bomType select bom; if (!string.IsNullOrEmpty(search.SearchString)) { query = query.Where(t => t.Name.ToLower().Contains(search.SearchString) || t.Description.ToLower().Contains(search.SearchString)); } if (!string.IsNullOrEmpty(userId)) { query = query.Where(t => t.CreatedBy.ToLower().Contains(userId.ToLower())); } query = Sort(query, search.SortColumn, search.SortDirection.ToString()); var data = Page(query, search.Page, search.PageSize).ToList(); return(data); }
/// <summary> /// パンプ菌を生成する場所を取得 /// </summary> void CreatePos() { int nowBomCount = bomCount.NowBomCount(); //爆弾を生成できるのは、ほかの爆弾がない時 かつ 爆弾の数が0でないときだけ if (nowBomCount == 0 || playerMove.IsTouch != true) { return; } if (Input.GetButtonUp("Fire1")) { pumpkinParent.SetActive(false); //#if UNITY_EDITOR // //rayの生成 Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); //#else //Ray ray = Camera.main.ScreenPointToRay(Input.touches[0].position); //#endif RaycastHit hit; //rayと衝突していなかったら以降の処理をしない if (Physics.Raycast(ray, out hit, layerMask) == false) { FlickInitialize(); return; } pumpkingAnimator.SetTrigger("IsThrow"); Vector3 createPos = new Vector3(hit.point.x, hit.point.y, hit.point.z); HoleParentSet(); AudioManager.Instance.PlaySE("Throw"); minionParent = Instantiate(massParentPre, createPos, Quaternion.identity); minionParent.transform.SetParent(holeType, true); //次のボムのタイプを取得 BomType nextBom = bomCount.NextBomType(); //パンプキングからパンプ菌を発射 throwBom.ThrowingBall(createPos, nextBom); bomMar = throwBom.GetBomObj().GetComponent <BomManager>(); PumpCreateData pumpData; pumpData.bomMar = bomMar; pumpData.displayCount = displayCount; pumpData.parentObj = minionParent; dataLis.Add(pumpData); //ボムの数を減らす bomCount.UseBom(); FlickInitialize(); delay = false; } }