Рефакторинг
This commit is contained in:
parent
0418490754
commit
fd167a3658
@ -11349,7 +11349,7 @@ Material:
|
||||
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
|
||||
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0}
|
||||
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _GlowColor: {r: 0.63892746, g: 0, b: 1, a: 1}
|
||||
- _GlowColor: {r: 0.87567496, g: 1, b: 0, a: 1}
|
||||
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767}
|
||||
- _OutlineColor: {r: 0.554717, g: 0.554717, b: 0.554717, a: 1}
|
||||
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
|
||||
@ -6208,7 +6208,10 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
prizeErrorSound: {fileID: 8300000, guid: 5fb832a50dc689845898a59217fd0535, type: 3}
|
||||
SoundNotification: 1
|
||||
PrizeNotificationSounds: []
|
||||
PrizeNotificationSounds:
|
||||
- {fileID: 8300000, guid: 1347f6385fc35fe4882304613a9fbfe9, type: 3}
|
||||
- {fileID: 8300000, guid: 2e6426be1392aea48936249e22b54e1f, type: 3}
|
||||
- {fileID: 8300000, guid: d38913d907d5e4244b25d6170a38686f, type: 3}
|
||||
--- !u!114 &259182291
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -9595,6 +9598,7 @@ RectTransform:
|
||||
- {fileID: 1585978625}
|
||||
- {fileID: 96763656}
|
||||
- {fileID: 1478745151}
|
||||
- {fileID: 1788407900}
|
||||
- {fileID: 209716858}
|
||||
m_Father: {fileID: 1122363135}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@ -9628,6 +9632,7 @@ MonoBehaviour:
|
||||
- {fileID: 1585978624}
|
||||
- {fileID: 96763655}
|
||||
- {fileID: 1478745150}
|
||||
- {fileID: 1788407899}
|
||||
- {fileID: 209716857}
|
||||
--- !u!1 &455099230
|
||||
GameObject:
|
||||
@ -9950,6 +9955,150 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 464592718}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &474604359
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 474604360}
|
||||
- component: {fileID: 474604362}
|
||||
- component: {fileID: 474604361}
|
||||
m_Layer: 5
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &474604360
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 474604359}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1788407900}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -80, y: -80}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &474604361
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 474604359}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: "\u0427\u0438\u0442\u0435\u0440\u0441\u0442\u0432\u043E \u0437\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043E!
|
||||
\u0412\u043E \u0432\u0440\u0435\u043C\u044F \u0438\u0433\u0440\u044B \u0438\u0433\u0440\u043E\u043A
|
||||
\u0434\u043E\u043B\u0436\u0435\u043D \u043F\u043E\u043B\u0430\u0433\u0430\u0442\u044C\u0441\u044F
|
||||
\u0442\u043E\u043B\u044C\u043A\u043E \u043D\u0430 \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0435
|
||||
\u0441\u043F\u043E\u0441\u043E\u0431\u043D\u043E\u0441\u0442\u0438, \u0437\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043E
|
||||
\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435
|
||||
\u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C, \u043D\u0435\u0439\u0440\u043E\u0441\u0435\u0442\u0435\u0439
|
||||
\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432
|
||||
\u0438\u043B\u0438 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0435 \u043F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0438
|
||||
\u0434\u0430\u044E\u0449\u0438\u0445 \u043F\u0440\u0435\u0438\u043C\u0443\u0449\u0435\u0441\u0442\u0432\u0430
|
||||
\u0438\u0433\u0440\u043E\u043A\u0443"
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2}
|
||||
m_sharedMaterial: {fileID: 4262305343556741190, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 32
|
||||
m_fontSizeBase: 32
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 16
|
||||
m_fontSizeMax: 64
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!222 &474604362
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 474604359}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &476158306
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -52178,6 +52327,82 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1787104271}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1788407899
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1788407900}
|
||||
- component: {fileID: 1788407902}
|
||||
- component: {fileID: 1788407901}
|
||||
m_Layer: 5
|
||||
m_Name: page4.1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &1788407900
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1788407899}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 474604360}
|
||||
m_Father: {fileID: 454272341}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 1282, y: 811.4}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1788407901
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1788407899}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 1304898661, guid: bff7731f029e97345b55849f0e330c32, type: 3}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &1788407902
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1788407899}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1788801325
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading;
|
||||
using UnityEngine;
|
||||
|
||||
public class BotThinkingState : IState
|
||||
|
||||
@ -133,7 +133,6 @@ public class CheckState : IState
|
||||
}
|
||||
else if (swipeToNextRightNow)
|
||||
{
|
||||
//nextState = new ClearFieldState(false, CellState.Player2);//начинает бот, раз мы победили
|
||||
ShowWinnerState showWinner = new ShowWinnerState(result);
|
||||
showWinner.subState = ShowWinnerState.ShowWinnerSubstates.ExitByTime;
|
||||
showWinner.timeRest = 4;
|
||||
@ -179,8 +178,8 @@ public class CheckState : IState
|
||||
VictoryScale vsBotScale = gm.botScale;
|
||||
DifficultyManager.instance.DecreaseDifficulty();
|
||||
CharacterEventBus.Instance.OnBotWin?.Invoke();
|
||||
if (gm.vsBotScore != 0)
|
||||
gm.vsBotScore -= 1;
|
||||
if (gm.vsBotScore != 0) gm.vsBotScore -= 1;
|
||||
|
||||
vsBotScale.SetMedalsCount(gm.vsBotScore);
|
||||
}
|
||||
}
|
||||
@ -195,8 +194,8 @@ public class CheckState : IState
|
||||
if (gm.botScale.isActiveAndEnabled) gm.botScale.ClearScale();
|
||||
if (gm.Player1Scale.isActiveAndEnabled) gm.Player1Scale.ClearScale();
|
||||
if (gm.Player2Scale.isActiveAndEnabled) gm.Player2Scale.ClearScale();
|
||||
|
||||
}
|
||||
|
||||
gm.stateMachine.ChangeState(nextState);
|
||||
}
|
||||
public void exit()
|
||||
|
||||
@ -9,8 +9,6 @@ public class PositioningState : IState
|
||||
GameObject chip;
|
||||
Transform chipPointer;
|
||||
SpriteRenderer pointerRend;
|
||||
//int minIndex;
|
||||
//int maxIndex;
|
||||
int index;
|
||||
int position;
|
||||
bool canMove;
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
|
||||
public class RulesState : IState
|
||||
{
|
||||
@ -14,7 +12,6 @@ public class RulesState : IState
|
||||
rules = GameManager.instance.rulesController;
|
||||
rules.Open();
|
||||
restTime = timeout;
|
||||
|
||||
}
|
||||
public void exit() => rules.Close();
|
||||
|
||||
@ -24,7 +21,6 @@ public class RulesState : IState
|
||||
if (In.GetButtonDownAnyPlayer(PlayerAction.left)) direction -= 1;
|
||||
if (In.GetButtonDownAnyPlayer(PlayerAction.right)) direction += 1;
|
||||
|
||||
|
||||
if (direction != 0)
|
||||
{
|
||||
rules.SwitchPage(direction);
|
||||
@ -38,11 +34,6 @@ public class RulesState : IState
|
||||
rules.Close();
|
||||
GameManager.instance.stateMachine.ChangeState(new MenuState());
|
||||
}
|
||||
|
||||
restTime -= Time.deltaTime;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class SetupPasswordState : IState
|
||||
public class SetupPasswordState : IState
|
||||
{
|
||||
public void enter()
|
||||
{
|
||||
|
||||
@ -24,7 +24,6 @@ public class ShowWinnerState : IState
|
||||
EndOption option;
|
||||
|
||||
RectTransform panel;
|
||||
Sprite selected, deselected;
|
||||
Image left, right;
|
||||
float speedY = 0;
|
||||
float acceleration = 500;
|
||||
@ -42,8 +41,6 @@ public class ShowWinnerState : IState
|
||||
TextMeshProUGUI ToMenuLabel;
|
||||
float TimeRest = 60;
|
||||
|
||||
/*Transform coinPanel;*/
|
||||
|
||||
bool needToPay;
|
||||
|
||||
|
||||
@ -72,8 +69,6 @@ public class ShowWinnerState : IState
|
||||
GameManager.timerManager.StopAllTimers();
|
||||
|
||||
panel = GameManager.EngamePanel;
|
||||
selected = GameManager.selectedPanel;
|
||||
deselected = GameManager.deselectedPanel;
|
||||
left = GameManager.ReplayButton;
|
||||
right= GameManager.MenuButton;
|
||||
InitPanel();
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
//Состояние, которое начинает раунд и подготавливает менеджера
|
||||
public class StartRoundState : IState
|
||||
{
|
||||
@ -15,7 +13,6 @@ public class StartRoundState : IState
|
||||
{
|
||||
try
|
||||
{
|
||||
//DebugWindow.Message("Старт раунда");
|
||||
gm = GameManager.instance;
|
||||
gm.currentPlayer = firstPlayer;
|
||||
|
||||
@ -23,8 +20,6 @@ public class StartRoundState : IState
|
||||
if (gm.gameMode == GameMode.pve)
|
||||
gm.timerManager.SetActiveTimer(CellState.Player1);//если деремся с ботом, держим таймер включенным
|
||||
|
||||
|
||||
|
||||
int difficultyIndex = DifficultyManager.instance.currentOpponent;
|
||||
if (gm.gameMode == GameMode.pve)
|
||||
{
|
||||
@ -35,7 +30,6 @@ public class StartRoundState : IState
|
||||
DualAvatarController.Instance.ShowCharacters();
|
||||
}
|
||||
|
||||
|
||||
gm.stateMachine.ChangeState(new StartTurnState());
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
|
||||
public class StartTurnState : IState
|
||||
{
|
||||
@ -7,11 +6,9 @@ public class StartTurnState : IState
|
||||
GameManager gm;
|
||||
public void enter()
|
||||
{
|
||||
//DebugWindow.Message("Старт хода");
|
||||
gm = GameManager.instance;
|
||||
gm.spawnChip();
|
||||
chip = gm.currentChip;
|
||||
//chip.SetActive(false);
|
||||
|
||||
if (gm.gameMode == GameMode.pvp)//переключаем таймеры только в pvp
|
||||
{
|
||||
@ -19,7 +16,6 @@ public class StartTurnState : IState
|
||||
LightUtility.Player(gm.currentPlayer);
|
||||
}
|
||||
|
||||
|
||||
if (chip != null)
|
||||
{
|
||||
//первый игрок ходит
|
||||
@ -45,10 +41,7 @@ public class StartTurnState : IState
|
||||
}
|
||||
GameManager.instance.stateMachine.ChangeState(nextState);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public void exit()
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user