private void shake() { mAnimating = true; mLeaf.moveBy(new Vector3(0.2f, 0, 0), 0.1f, () => { mLeaf.moveBy(new Vector3(-0.4f, 0, 0), 0.2f, () => { mLeaf.moveBy(new Vector3(0.2f, 0, 0), 0.1f, () => { mAnimating = false; }); }); }); }
//音符を消した時の演出 protected void productHit(Note aNote, TypeEvaluation.Evaluation aEvaluation) { //評価表示オブジェクト生成 MyBehaviour tBehaviour = MyBehaviour.create <MyBehaviour>(); tBehaviour.name = "evaluation"; SpriteRenderer tRenderer = tBehaviour.gameObject.AddComponent <SpriteRenderer>(); tBehaviour.transform.parent = parent.mScore.transform; tBehaviour.transform.localScale = new Vector3(1.7f, 1.7f, 1); tBehaviour.transform.localPosition = new Vector3(0, 0, 0); tBehaviour.transform.Translate(aNote.transform.position - parent.mScore.transform.position); tBehaviour.positionZ = -2; //sprite設定とアニメーション switch (aEvaluation) { case TypeEvaluation.Evaluation.perfect: tRenderer.sprite = Resources.Load <Sprite>("sprites/point/perfect"); tBehaviour.moveBy(new Vector3(0, 1, 0), 1, () => { tBehaviour.delete(); }); break; case TypeEvaluation.Evaluation.great: tRenderer.sprite = Resources.Load <Sprite>("sprites/point/great"); tBehaviour.moveBy(new Vector3(0, 0.6f, 0), 1, () => { tBehaviour.delete(); }); break; case TypeEvaluation.Evaluation.good: tRenderer.sprite = Resources.Load <Sprite>("sprites/point/good"); tBehaviour.moveBy(new Vector3(0, 0.4f, 0), 1, () => { tBehaviour.delete(); }); break; case TypeEvaluation.Evaluation.bad: tRenderer.sprite = Resources.Load <Sprite>("sprites/point/bad"); tBehaviour.moveBy(new Vector3(0, 0.1f, 0), 1, () => { tBehaviour.delete(); }); break; case TypeEvaluation.Evaluation.miss: tRenderer.sprite = Resources.Load <Sprite>("sprites/point/miss"); tBehaviour.moveBy(new Vector3(0, -1, 0), 1, () => { tBehaviour.delete(); }); break; } }
/// <summary>食糧取得or損失アニメーション</summary> public static void getFood(PlayerStatusDisplay aDisplay, int aFood, Action aCallback) { TextMesh tMesh = MyBehaviour.create <TextMesh>(); tMesh.text = (aFood >= 0 ? "+" : "") + aFood.ToString(); tMesh.name = "getFoodMesh : " + tMesh.text; tMesh.fontSize = 100; tMesh.characterSize = 0.04f; tMesh.anchor = TextAnchor.MiddleLeft; tMesh.transform.position = new Vector3(aDisplay.positionX - 0.6f, aDisplay.positionY - 0.1f, -20); Vector2 tDirection; if (aFood >= 0) { //取得 tMesh.color = new Color(0, 1, 1); tDirection = new Vector2(0, 0.3f); } else { //損失 tMesh.color = new Color(1, 0, 0); tDirection = new Vector2(0, -0.3f); } MyBehaviour tBehaviour = tMesh.gameObject.AddComponent <MyBehaviour>(); tBehaviour.moveBy(tDirection, 1.2f, () => { tBehaviour.delete(); aCallback(); }); }
//diceを表示する public void setDice(Action aCallback) { mDices.moveBy(new Vector3(0, -7, 0), 0.4f, aCallback); }