//決定処理キャンセル //実行する場合は、必ずDecide()関数実行直後に行うこと void DecideCancel() { //進んだステップを一つ戻す NowActionStep--; if (NowActionStep < ACTION_STEP.CHARSELECT) { NowActionStep = ACTION_STEP.ACTION_STEP_NUM - 1; } TurnEnd = false; }
private void Update() { VerifyLocalController(); wantedDelta += Time.deltaTime; if (actionStep != ACTION_STEP.NONE) { actionDelta += Time.deltaTime; switch (actionStep) { case ACTION_STEP.MOVE_IN: if (actionDelta > moveInMax) { actionDelta = 0f; actionStep = ACTION_STEP.PAUSE; } else { bgXY = Vector2.Lerp(bgLeft, bgCenter, actionDelta / moveInMax); wantedXY = Vector2.Lerp(wantedRight, wantedCenter, actionDelta / moveInMax); } break; case ACTION_STEP.PAUSE: if (actionDelta > pauseMax) { actionDelta = 0f; actionStep = ACTION_STEP.MOVE_OUT; } else { bgXY = bgCenter; wantedXY = wantedCenter; } break; case ACTION_STEP.MOVE_OUT: if (actionDelta > moveOutMax) { actionDelta = 0f; actionStep = ACTION_STEP.NONE; } else { bgXY = Vector2.Lerp(bgCenter, bgRight, actionDelta / moveInMax); wantedXY = Vector2.Lerp(wantedCenter, wantedLeft, actionDelta / moveInMax); } break; } } }
private void Action() { actionStep = ACTION_STEP.MOVE_IN; wantedDelta = 0f; actionDelta = 0f; bgLeft = new Vector2((float)(-wantedBg.width), wantedActionHeight); bgCenter = new Vector2((float)((Screen.width - wantedBg.width) / 2), wantedActionHeight); bgRight = new Vector2((float)Screen.width, wantedActionHeight); wantedRight = new Vector2((float)Screen.width, wantedActionHeight); wantedCenter = new Vector2((float)((Screen.width - wanted.width) / 2), wantedActionHeight); wantedLeft = new Vector2((float)(-wanted.width), wantedActionHeight); bgXY = bgLeft; wantedXY = wantedRight; }
//決定キー押下関数 //押した後処理しないなら呼び出しだけ //押した後処理するならif文をつけて呼び出し bool Decide() { //決定・次のステップへ if (Input.GetKeyDown(DecideKey)) { NowActionStep++; if (NowActionStep >= ACTION_STEP.ACTION_STEP_NUM) { NowActionStep = ACTION_STEP.CHARSELECT; TurnEnd = true; } return(true); } return(false); }
private void Start() { wantedDelta = 1f; actionStep = ACTION_STEP.NONE; TeamMatch component = GetComponent <TeamMatch>(); if (null != component) { isTeamMatch = true; } IndividualMatch component2 = GetComponent <IndividualMatch>(); if (null != component2) { isTeamMatch = false; } red = GlobalVars.Instance.GetByteColor2FloatColor(245, 83, 26); blue = GlobalVars.Instance.GetByteColor2FloatColor(25, 159, 237); orange = GlobalVars.Instance.GetByteColor2FloatColor(250, 190, 27); }
// Use this for initialization void Start() { TurnEnd = false; NowActionStep = 0; NowSelectChar = 0; }