/// <summary> /// エンカウント /// </summary> /// <param name="aMapName">エンカウトしたマップのマップ名</param> /// <param name="aEncountKey">エンカウントKey</param> /// <param name="onEnd">戦闘終了時コールバック</param> public void onEncount(string aMapName, string aEncountKey, Action <BattleEventResult> aOnEnd) { Debug.Log("encount:(" + aMapName + "," + aEncountKey + ")"); MyBehaviour.setTimeoutToIns(3f, () => { Debug.Log("end encount battle"); aOnEnd(BattleEventResult.win); }); }
public void checkAllOpen() { if (!(mDice1.mIsOpen & mDice2.mIsOpen & mDice3.mIsOpen)) { return; } MyBehaviour.setTimeoutToIns(1, () => { mArg.get <Action <int> >("opened")(getTotalNumber()); }); }
/// <summary>プレイヤの順番シャッフル</summary> public static void playerShuffle(PlayerStatusDisplay[] aDisplay, PlayerStatus[] aStatus, int[] aTurn, Action aCallback) { //手番順に座標を配列に格納 Vector2[] tTurnPosition = new Vector2[aDisplay.Length]; for (int i = 0; i < aDisplay.Length; i++) { int tTurn = aStatus[i].mTurn; tTurnPosition[tTurn] = aDisplay[i].position2D; } //シャッフル結果の座標をプレイヤ番号順に格納 Vector2[] tResultPosition = new Vector2[aDisplay.Length]; for (int i = 0; i < aDisplay.Length; i++) { int tPlayerNum = aTurn[i]; tResultPosition[tPlayerNum] = tTurnPosition[i]; } //全てのdisplayの中央座標 Vector2 tCenter = new Vector2(0, 0); for (int i = 0; i < aDisplay.Length; i++) { tCenter += tTurnPosition[i]; } tCenter /= aDisplay.Length; //アニメーション MyBehaviour.setTimeoutToIns(1, () => { //中央に集める CallbackSystem tSystem = new CallbackSystem(); for (int i = 0; i < aDisplay.Length; i++) { aDisplay[i].moveTo(tCenter, 0.2f, tSystem.getCounter()); } tSystem.then(() => { MyBehaviour.setTimeoutToIns(0.5f, () => { //それぞれの位置へ移動 CallbackSystem tSystem2 = new CallbackSystem(); for (int i = 0; i < aDisplay.Length; i++) { aDisplay[i].moveTo(tResultPosition[i], 0.2f, tSystem2.getCounter()); } tSystem2.then(aCallback); }); }); }); }
private void Start() { Arg tArg = MySceneManager.getArg("eventBox"); mText.text = tArg.get <string>("text"); mWindow.scale2D = new Vector2(0, 0); mBox.moveTo(new Vector3(0, 1, 0), 0.4f, () => { MyBehaviour.setTimeoutToIns(0.2f, () => { MySoundPlayer.playSe("open", false); mEventBox.scaleTo(new Vector2(0, 0), 0.3f); mWindow.scaleTo(new Vector2(1, 1), 0.4f); for (int i = 0; i < 5; i++) { throwLight(mBox.worldPosition); } MyBehaviour.setTimeoutToIns(1.5f, () => { MySceneManager.closeScene("eventBox"); }); }); }); }
static public void lostCoin(Vector3 aPosition, string aLabel, Action aCallback) { MyBehaviour tContainer = MyBehaviour.create <MyBehaviour>(); tContainer.name = "lostCoin"; tContainer.position = aPosition; MySoundPlayer.playSe("lost", false); CallbackSystem tSystem = new CallbackSystem(); KinCoin tPrefab = Resources.Load <KinCoin>("prefabs/game/effect/coin"); for (int i = 0; i < 10; i++) { Action tCounter = tSystem.getCounter(); MyBehaviour.setTimeoutToIns(0.1f * i, () => { KinCoin tCoin = GameObject.Instantiate(tPrefab); tCoin.transform.SetParent(tContainer.transform, false); tCoin.lost(tCounter); }); } tSystem.then(aCallback); }
/// <summary> /// 外部処理のイベント発火 /// </summary> /// <param name="aData">イベントデータ</param> /// <param name="onEnd">終了時コールバック(MapEvent:このイベントを実行,string:nextEventsプロパティ内のこのプロパティのイベントを実行,null:実行しない)</param> public void onEvent(Arg aData, Action <object> aOnEnd) { switch (aData.get <string>("name")) { case "conversation": Debug.Log("conversation"); MyBehaviour.setTimeoutToIns(2f, () => { Debug.Log("end conversation"); aOnEnd(null); }); break; case "log": Debug.Log("log : " + aData.get <string>("text")); aOnEnd(null); break; default: Debug.Log("定義されていない外部処理イベント「" + aData.get <string>("name") + "」"); aOnEnd(null); break; } }
public override void openDice(DiceMain aDiceMain) { MyBehaviour.setTimeoutToIns(0.2f, aDiceMain.open1); MyBehaviour.setTimeoutToIns(0.6f, aDiceMain.open2); MyBehaviour.setTimeoutToIns(1f, aDiceMain.open3); }
/// <summary> /// マップ移動時のフェードイン開始通知(=マップ再生成完了通知) /// </summary> /// <param name="aOnEnd">フェードイン演出終了時に呼ぶ</param> public void onMoveMapFadeIn(Action aOnEnd) { MyBehaviour.setTimeoutToIns(1f, aOnEnd); }
public override void flipCard(Action aFlipThen) { MyBehaviour.setTimeoutToIns(0.4f, () => { aFlipThen(); }); MyBehaviour.setTimeoutToIns(0.8f, () => { aFlipThen(); }); MyBehaviour.setTimeoutToIns(1.2f, () => { aFlipThen(); }); }