tutorial done

This commit is contained in:
2026-05-16 05:13:34 +05:30
parent c2144630fd
commit 22e1a8cf50
10 changed files with 8359 additions and 1905 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3 -15
View File
@@ -1,16 +1,4 @@
Logger initiated at 5/6/2026 1:30:30 AM Logger initiated at 5/16/2026 5:12:27 AM
[5/6/2026 1:30:30 AM] Cupid settings updated [5/16/2026 5:12:27 AM] Cupid settings updated
[5/6/2026 1:30:30 AM] Cupid settings updated [5/16/2026 5:12:27 AM] Cupid settings updated
[5/6/2026 1:30:32 AM] Starting matchmake as warlock
[5/6/2026 1:30:35 AM] Still waiting: {"ok":true,"entry_fee":21,"rc_prize":37,"for_red":{"Players":[{"Name":"warlock","LastSeen":1778011235432,"UserId":4,"l10_wins":7,"l10_losses":0}],"GameName":"soccar","Port":26248,"InitTime":1778011235432,"entry_fee":21,"match_id":261,"rc_prize":37,"your_team":"red"},"for_blue":null}
[5/6/2026 1:30:37 AM] Got into a room
[5/6/2026 1:30:37 AM] {"ok":true,"entry_fee":21,"rc_prize":37,"for_red":{"Players":[{"Name":"warlock","LastSeen":1778011236864,"UserId":4,"l10_wins":7,"l10_losses":0},{"Name":"warlock2","LastSeen":1778011236463,"UserId":5,"l10_wins":0,"l10_losses":7}],"GameName":"soccar","Port":26248,"InitTime":1778011235432,"entry_fee":21,"match_id":261,"instance_started":true,"rc_prize":37,"your_team":"red"},"for_blue":{"Players":[{"Name":"warlock","LastSeen":1778011236864,"UserId":4,"l10_wins":7,"l10_losses":0},{"Name":"warlock2","LastSeen":1778011236463,"UserId":5,"l10_wins":0,"l10_losses":7}],"GameName":"soccar","Port":26248,"InitTime":1778011235432,"entry_fee":21,"match_id":261,"instance_started":true,"rc_prize":37,"your_team":"blue"}}
[5/6/2026 1:30:37 AM] Configured dedicated match reporting for match id 261 with secret 38516e39d3406225b7c3015a66e5d25c54e9b2024c0755212122bdcea3e3a328 and internal api base https://kickkingsapi.playpoolstudios.com
[5/6/2026 1:30:37 AM] Setting cupid to load game scene
[5/6/2026 1:30:37 AM] Loading game scene
[5/6/2026 1:30:43 AM] Starting client at $kickkingsapi.playpoolstudios.com:26248
[5/6/2026 1:30:43 AM] Client connected
[5/6/2026 1:30:57 AM] Client disconnected
[5/6/2026 1:31:02 AM] Cupid settings updated
[5/6/2026 1:31:02 AM] Cupid settings updated
File diff suppressed because it is too large Load Diff
+3
View File
@@ -52,11 +52,14 @@ public class MainMenuManager : MonoBehaviour
int _matchEntryFeeCoins = FallbackEntryFeeCoins; int _matchEntryFeeCoins = FallbackEntryFeeCoins;
public static MainMenuManager instance;
void Awake() void Awake()
{ {
if(LoginManager.instance==null){ if(LoginManager.instance==null){
SceneManager.LoadScene(0); SceneManager.LoadScene(0);
} }
instance = this;
} }
void Start() void Start()
+120
View File
@@ -0,0 +1,120 @@
using UnityEngine;
using UnityEngine.UI;
public class TutorialManagerMainMenu : MonoBehaviour
{
public const string TUTORIAL_PREF_KEY = "tutorial_main_menu_completed";
public bool forceShow= false;
public GameObject tutorialPanel;
public int curScreen = 1;
[Header("Screen 1")]
public GameObject screen1;
public Button btnNext1;
public Button btnSkip;
[Header("Screen 2")]
public GameObject screen2;
public Button btnNext2;
[Header("Screen 3")]
public GameObject screen3;
public GameObject buyScreen;
[Header("Screen 4")]
public GameObject screen4;
[Header("Screen 5")]
public GameObject screen5;
[Header("Screen 6")]
public GameObject screen6;
public Button btnFinish;
void Start()
{
btnNext1.onClick.AddListener(OnNext1);
btnSkip.onClick.AddListener(OnSkip);
btnNext2.onClick.AddListener(OnNext2);
btnFinish.onClick.AddListener(OnTutorialCompleted);
if(!forceShow){
if(PlayerPrefs.HasKey(TUTORIAL_PREF_KEY)){
tutorialPanel.SetActive(false);
return;
}
if(LoginManager.CurrentUser.rc > 0){
tutorialPanel.SetActive(false);
return;
}
}
tutorialPanel.SetActive(true);
screen1.SetActive(true);
}
void OnNext1(){
screen1.SetActive(false);
screen2.SetActive(true);
curScreen = 2;
}
void OnSkip(){
tutorialPanel.SetActive(false);
OnTutorialCompleted();
}
void OnNext2(){
screen2.SetActive(false);
screen3.SetActive(true);
curScreen = 3;
}
void OnNext3(){
screen3.SetActive(false);
screen4.SetActive(true);
curScreen = 4;
}
void OnNext4(){
MainMenuManager.instance.ShowMainMenuScreen();
screen4.SetActive(false);
screen5.SetActive(true);
curScreen = 5;
}
void OnNext5(){
screen5.SetActive(false);
screen6.SetActive(true);
curScreen = 6;
}
public void OnTutorialCompleted(){
PlayerPrefs.SetInt(TUTORIAL_PREF_KEY, 1);
PlayerPrefs.Save();
tutorialPanel.SetActive(false);
}
void Update()
{
if(curScreen < 2){return;}
if(curScreen == 3 && buyScreen.activeSelf){
OnNext3();
}
if(curScreen == 4 && LoginManager.CurrentUser.rc > 0){
OnNext4();
}
if(curScreen == 5 && MainMenuManager.instance.gameModesScreen.activeSelf){
OnNext5();
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a813b293eefc93349a0238a65e962944
+103
View File
@@ -0,0 +1,103 @@
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.UI;
/// <summary>
/// Inverted stencil mask (see materialForRendering). For raycasts, assign
/// <see cref="raycastPassThroughRects"/> to rects that match each visual "hole"
/// — clicks there wont hit this graphic and pass to UI behind.
///
/// Parent <see cref="Mask"/> also implements <see cref="ICanvasRaycastFilter"/> and only
/// allows points inside its RectTransform. A fullscreen child under a small mask would
/// otherwise fail the raycast outside that rect (dimmed area lets clicks through) while
/// still blocking inside the mask bounds. We skip only Mask/RectMask2D in the raycast
/// walk (<see cref="Graphic.Raycast(UnityEngine.Vector2,UnityEngine.Camera,bool)"/> with
/// ignoreMasks) so hit testing matches the fullscreen Image; rendering still uses stencil
/// because <see cref="MaskableGraphic.maskable"/> stays true.
/// </summary>
public class CutoutMaskUI : Image
{
[Tooltip("Rects matching cutout/hole areas. Clicks inside are not consumed by this Image. Leave empty to use the parent Masks RectTransform.")]
[SerializeField] RectTransform[] raycastPassThroughRects;
[Tooltip("The Image on the same object as Mask is usually the cutout shape and still receives raycasts. When this is on, that graphics Raycast Target is turned off while this component is enabled so the hole reaches UI behind the overlay.")]
[SerializeField] bool disableRaycastOnParentMaskGraphic = true;
Mask cachedParentMask;
Graphic cachedMaskGraphic;
bool storedMaskGraphicRaycast;
bool storedMaskGraphicRaycastValid;
public override bool Raycast(Vector2 sp, Camera eventCamera)
{
return Raycast(sp, eventCamera, ignoreMasks: true);
}
public override Material materialForRendering{
get{
Material material = new Material(base.materialForRendering);
material.SetInt("_StencilComp", (int)CompareFunction.NotEqual);
return material;
}
}
protected override void OnEnable()
{
base.OnEnable();
if (!disableRaycastOnParentMaskGraphic)
return;
cachedParentMask = GetComponentInParent<Mask>();
if (cachedParentMask == null)
return;
cachedMaskGraphic = cachedParentMask.graphic;
if (cachedMaskGraphic == null || cachedMaskGraphic == this)
return;
storedMaskGraphicRaycastValid = true;
storedMaskGraphicRaycast = cachedMaskGraphic.raycastTarget;
cachedMaskGraphic.raycastTarget = false;
}
protected override void OnDisable()
{
if (storedMaskGraphicRaycastValid && cachedMaskGraphic != null)
{
cachedMaskGraphic.raycastTarget = storedMaskGraphicRaycast;
storedMaskGraphicRaycastValid = false;
}
cachedMaskGraphic = null;
cachedParentMask = null;
base.OnDisable();
}
public override bool IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera)
{
if (IsInsidePassThroughHole(screenPoint, eventCamera))
return false;
return base.IsRaycastLocationValid(screenPoint, eventCamera);
}
bool IsInsidePassThroughHole(Vector2 screenPoint, Camera eventCamera)
{
if (raycastPassThroughRects != null)
{
for (int i = 0; i < raycastPassThroughRects.Length; i++)
{
RectTransform rect = raycastPassThroughRects[i];
if (rect != null && RectTransformUtility.RectangleContainsScreenPoint(rect, screenPoint, eventCamera))
return true;
}
}
Mask mask = cachedParentMask != null ? cachedParentMask : GetComponentInParent<Mask>();
if (mask != null && mask.rectTransform != null &&
RectTransformUtility.RectangleContainsScreenPoint(mask.rectTransform, screenPoint, eventCamera))
return true;
return false;
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 721d1e0343adc3c42b4508f55c455957