private void OnTriggerEnter2D(Collider2D collision) { // アイテムを取ったらスコア加算をする if (collision.gameObject.tag == "Item") { ItemEffect item = collision.gameObject.GetComponent <ItemEffect>(); scoreManager.AddScore(item.score); sweetGetCount++; // エフェクトの取得 EffekseerHandle handle = default; // ボーナス中かどうかで取得した時のエフェクトを変更する if (gameMainManager.CoinGetRate > 1.0f) { handle = EffekseerSystem.PlayEffect(heartShineEffect, transform.position); SoundManager.Instance.PlaySE("Heart_Shine"); } else { handle = EffekseerSystem.PlayEffect(heartEffect, transform.position); SoundManager.Instance.PlaySE("Heart"); } // エフェクトを更新で追従させるためにリストにいれる heartEffectList.Add(handle); } }
// Update is called once per frame void Update() { _GestureManager = GestureManager.GetComponent <GestureManager>(); _BodyManager = BodySourceManager.GetComponent <BodySourceManager>(); _ColorBodyView = BodySourceManager.GetComponent <ColorBodySourceView>(); if (_GestureManager == null || _ColorBodyView == null || _BodyManager == null) { return; } if (_MainCamera == null) { _MainCamera = GameObject.Find("ConvertCamera").GetComponent <Camera>(); } if (!_IsRegMethod) { Debug.Log("REG"); _GestureManager.GestureDetected += _GestureManager_GestureDetected; _IsRegMethod = true; } foreach (GameObject body in _ColorBodyView.GetBodies()) { AddingTrailRendererToBody(body); } // EffekseerHandle eh = EffekseerSystem.PlayEffect(_EffectNames[2], _ColorBodyView.GetBodies()[0].transform.Find(JointType.HandLeft.ToString()).transform.position); var floorPlane = _BodyManager.FloorClipPlane; var comp = Quaternion.FromToRotation(new Vector3(floorPlane.X, floorPlane.Y, floorPlane.Z), Vector3.left); eh.SetRotation(_BodyManager.GetData()[0].JointOrientations[JointType.HandLeft].Orientation.ToQuaternion(comp)); }
private void OnTriggerEnter2D(Collider2D collision) { // プレイヤーに当たったら破壊される if (collision.gameObject.tag == "Player") { // 破壊エフェクトの再生 EffekseerSystem.PlayEffect(Effect, transform.position); // SEの再生 SoundManager.Instance.PlaySE(BreakSEName); // コイン減算UIを表示 GameObject obj = Instantiate(MinusCoinUIObject, CanvasObject.transform); obj.transform.position = RectTransformUtility.WorldToScreenPoint(cameraObject, this.transform.position); obj.GetComponent <TextMeshProUGUI>().text = SubScore.ToString(); if (m_TutrialManager.tutrial == TutrialSceneManager.TUTRIAL.TUTRIAL_SYOKUDAI) { //チュートリアルの変更 m_TutrialManager.TutrialChange(m_StateID); batumage.StartDisplay(); } Destroy(this.gameObject); } }
private void OnTriggerEnter2D(Collider2D collision) { if (!isAngry) { if (collision.tag == "Player") { isAngry = true; // 店員の色を変える Color color = sprite.color; color.b = 0.5f; color.g = 0.5f; sprite.color = color; // 怒りエフェクトを再生 effectHandle = EffekseerSystem.PlayEffect(effect, this.transform.position); // 怒り音を再生 SoundManager.Instance.PlaySE("Angry"); // 時間減算UIを表示 GameObject obj = Instantiate(MinusTimeUIObject, CanvasObject.transform); obj.transform.position = RectTransformUtility.WorldToScreenPoint(cameraObject, this.transform.position); obj.GetComponent <TextMeshProUGUI>().text = (-MinusTime).ToString(); //チュートリアルの変更 m_TutrialManager.TutrialChange(m_StateID); batumage.StartDisplay(); } } }
private void PlayEffect() { if (!String.IsNullOrEmpty(effectName) && emitterObject) { effectHandle = EffekseerSystem.PlayEffect(effectName, emitterObject.transform.position); } }
/// <summary> /// 設定されているエフェクトを再生 /// </summary> public void Play() { var h = EffekseerSystem.PlayEffect(effectName, transform.position); h.SetRotation(transform.rotation); h.SetScale(transform.localScale); handle = h; }
/// <summary> /// 解放エフェクトの開始 /// </summary> public void StartReleaseEffect() { float size = cameraController.GetScreenRight() - cameraController.GetScreenLeft(); size = size / 5.0f; // エフェクト再生(画面の中心から1/5の位置に出す) releaseEffectHandle = EffekseerSystem.PlayEffect(releaseEffect, new Vector3(-size, 0f)); SoundManager.Instance.PlaySE("Release"); }
private void _GestureManager_GestureDetected(KeyValuePair <Gesture, DiscreteGestureResult> result, ulong id) { Debug.Log("REC EVNET : " + result.Key.Name + " : " + id); switch (result.Key.Name) { case "Jump02": if (result.Value.Confidence < 0.6) { return; } Debug.Log("Jump02 Confidence : " + result.Value.Confidence); // Jumpした Vector3 pos = _ColorBodyView.GetBody(id).transform.Find(JointType.SpineMid.ToString()).transform.position; EffekseerSystem.PlayEffect(_EffectNames[0], pos); break; case "OpenMenu": if (result.Value.Confidence < 0.5) { return; } _MainCamera.backgroundColor = ((_MainCamera.backgroundColor == Color.black) ? Color.gray : Color.black); Debug.Log("OpenMenu Confidence : " + result.Value.Confidence); break; case "Punch_Left": Debug.Log("Punch Left" + result.Value.Confidence); if (result.Value.Confidence < 0.2) { return; } EffekseerSystem.PlayEffect(_EffectNames[1], _ColorBodyView.GetBody(id).transform.Find(JointType.HandRight.ToString()).transform.position); break; case "Punch_Right": Debug.Log("Punch Right" + result.Value.Confidence); if (result.Value.Confidence < 0.2) { return; } EffekseerSystem.PlayEffect(_EffectNames[1], _ColorBodyView.GetBody(id).transform.Find(JointType.HandLeft.ToString()).transform.position); break; } }
// Use this for initialization void Start() { var h = EffekseerSystem.PlayEffect(Effect_name, this.transform.position); h.SetScale(this.transform.localScale); h.SetRotation(this.transform.rotation); Effect_Delete_Time = 0; }
// -------------------- // Effect Functions // -------------------- private void Play(EffectObject _eff) { var tran = _eff.Obj.transform; var h = EffekseerSystem.PlayEffect(_eff.EffectName, tran.position); h.SetRotation(tran.rotation); h.SetScale(tran.localScale); _eff.Handle = h; }
void Update() { // マウスがクリックされたらプレイヤーをジャンプ状態にする。 if (Input.GetMouseButtonDown(0)) { if (tutrialManager.state == TutrialSceneManager.STATE.MAIN && tutrialManager.tutrial != TutrialSceneManager.TUTRIAL.TUTRIAL_CHEF && tutrialManager.tutrial != TutrialSceneManager.TUTRIAL.TUTRIAL_DESCRIPTION && tutrialManager.tutrial != TutrialSceneManager.TUTRIAL.TUTRIAL_FINISHDESCRIPTION) { if (JumpFlag == false) { JumpFlag = true; rigidBody.velocity = Vector2.zero; rigidBody.AddForce(new Vector2(0.0f, JumpPower), ForceMode2D.Impulse); // エフェクトの取得 EffekseerSystem.PlayEffect(jumpEffect, transform.position + new Vector3(0f, -10f)); // ジャンプ音を再生 SoundManager.Instance.PlaySE("Jump"); } else if (TwoJumpFlag == false) { { TwoJumpFlag = true; rigidBody.velocity = new Vector2(rigidBody.velocity.x, 0.0f); rigidBody.AddForce(new Vector2(0.0f, JumpPower), ForceMode2D.Impulse); // エフェクトの取得 EffekseerSystem.PlayEffect(jumpEffect, transform.position + new Vector3(0f, -10f)); // ジャンプ音を再生 SoundManager.Instance.PlaySE("Jump"); } } } } // ハートエフェクトを追従させる foreach (EffekseerHandle handle in heartEffectList) { if (handle.enabled) { handle.SetLocation(this.transform.position); } else { // リストから除去 heartEffectList.Remove(handle); } } }
public void PlayAtRandom() { Vector3 position = new Vector3( Random.Range(-10.0f, 10.0f), Random.Range(0.0f, 3.0f), Random.Range(-10.0f, 10.0f)); Quaternion rotation = Quaternion.AngleAxis( Random.Range(-180.0f, 180.0f), Vector3.up); var effectHandle = EffekseerSystem.PlayEffect(currentEffectName, position); effectHandle.SetRotation(rotation); }
void Update() { // マウスがクリックされたらプレイヤーをジャンプ状態にする。 if (Input.GetMouseButtonDown(0)) { if (gameMainManager.state == GameMainManager.STATE.MAIN) { if (jumpFlag == false) { jumpFlag = true; rigidBody2D.velocity = Vector2.zero; rigidBody2D.AddForce(new Vector2(0.0f, jumpPower), ForceMode2D.Impulse); jumpCount++; // エフェクトの取得 EffekseerSystem.PlayEffect(jumpEffect, transform.position + new Vector3(0f, -10f)); // ジャンプ音を再生 SoundManager.Instance.PlaySE("Jump"); } else if (twoJumpFlag == false) { twoJumpFlag = true; rigidBody2D.velocity = new Vector2(rigidBody2D.velocity.x, 0.0f); rigidBody2D.AddForce(new Vector2(0.0f, jumpPower), ForceMode2D.Impulse); jumpCount++; // エフェクトの取得 EffekseerSystem.PlayEffect(jumpEffect, transform.position + new Vector3(0f, -10f)); // ジャンプ音を再生 SoundManager.Instance.PlaySE("Jump"); } } } // ハートエフェクトを追従させる foreach (EffekseerHandle handle in heartEffectList) { if (handle.enabled) { handle.SetLocation(this.transform.position); } else { // リストから除去 heartEffectList.Remove(handle); } } }
private void OnTriggerEnter2D(Collider2D collision) { // アイテムを取ったら if (collision.gameObject.tag == "Item") { ItemEffect item = collision.gameObject.GetComponent <ItemEffect>(); // エフェクトの取得 EffekseerHandle handle = EffekseerSystem.PlayEffect(heartEffect, transform.position); SoundManager.Instance.PlaySE("Heart"); // エフェクトを更新で追従させるためにリストにいれる heartEffectList.Add(handle); } }
//=========================================================================================================== /// <summary> /// 服の黒塗処理 /// </summary> private void FillBlack( ) { // old未作成なら作成する if (ClothingChild.Count > 0 && oldClothingChild.Count == 0) { for (int i = 0; i < ClothingChild.Count; i++) { oldClothingChild.Add(inventory.IsHaveItem(playfabstore.StoreItems[i].ItemId)); } } for (int i = 0; i < ClothingChild.Count; i++) { bool have = inventory.IsHaveItem(playfabstore.StoreItems[i].ItemId); if (have) { ClothingChild[i].SetColor(new Color(1f, 1f, 1f)); } else { ClothingChild[i].SetColor(new Color(0.2f, 0.2f, 0.2f)); } if (have == true && oldClothingChild[i] == false) { // 0番服はデフォルト服なのでエフェクト再生などは無し if (i != 0) { // 購入ボタンが押されていた if (isBuyButtonPush) { // 買った瞬間なのでエフェクトを再生する EffekseerSystem.PlayEffect(buyEffect, this.transform.position); SoundManager.Instance.PlaySE("Buy"); isBuyButtonPush = false; } } oldClothingChild[i] = true; } } }
private void OnTriggerEnter2D(Collider2D collision) { // プレイヤーに当たったら破壊される if (collision.gameObject.tag == "Player") { // スコアの減算 transform.root.GetComponent <GameMainManager>().scoreManager.AddScore(SubScore); // 破壊エフェクトの再生 EffekseerSystem.PlayEffect(Effect, transform.position); // SEの再生 SoundManager.Instance.PlaySE(BreakSEName); // コイン減算UIを表示 GameObject obj = Instantiate(MinusCoinUIObject, CanvasObject.transform); obj.transform.position = RectTransformUtility.WorldToScreenPoint(cameraObject, this.transform.position); obj.GetComponent <TextMeshProUGUI>().text = SubScore.ToString(); obj.transform.SetAsFirstSibling(); //一番上(uGUIなら背面) Destroy(this.gameObject); } }
public void PlayAtZero() { EffekseerSystem.PlayEffect(currentEffectName, Vector3.zero); }
/// <summary> /// ハートエフェクトの出現 /// </summary> public void StartHeartEffect() { EffekseerSystem.PlayEffect(heartEffect, this.transform.position); SoundManager.Instance.PlaySE("Heart"); }
public void PlayAtZero() { var effect = EffekseerSystem.PlayEffect(currentEffectName, Vector3.zero); effect.SetTargetLocation(new Vector3(0, 10, 0)); }
public void Play() { handle = EffekseerSystem.PlayEffect(effectName, transform.position); UpdateTransform(); }
public void StartShockEffect() { var eff = EffekseerSystem.PlayEffect("Shock", transform.position); eff.SetScale(new Vector3(0.4f, 0.3f, 0.3f)); }