using System; using System.Collections; using Mirror; using UnityEngine; using UnityEngine.Networking; using UnityEngine.UI; using DG.Tweening; public class GameTutorialManager : MonoBehaviour { public const string CpuOpponentName = "CPU"; public const string DefaultGameSceneName = "Game"; public static bool tutorialModeTrigger = false; public bool isTutorial = false; public static bool tutorialModeEnabled = false; public AiBotController aiController; [Header("UI")] public CanvasGroup intro_shoot; public CanvasGroup intro_goal; public float introFadeDuration = 0.3f; Button _introShootButton; Button _introGoalButton; bool _shootIntroDismissed; bool _goalIntroDismissed; bool _introVisible; void Awake() { #if UNITY_SERVER tutorialModeEnabled = false; tutorialModeTrigger = false; HideIntroImmediate(intro_shoot); HideIntroImmediate(intro_goal); enabled = false; return; #endif tutorialModeEnabled = false; if (isTutorial) tutorialModeTrigger = true; if (tutorialModeTrigger) tutorialModeEnabled = true; tutorialModeTrigger = false; if (!tutorialModeEnabled) { HideIntroImmediate(intro_shoot); HideIntroImmediate(intro_goal); } } void OnEnable() { GameManager.OnTeamChanged += OnTeamChanged; } void OnDisable() { GameManager.OnTeamChanged -= OnTeamChanged; } void OnDestroy() { if (tutorialModeEnabled) tutorialModeEnabled = false; if (intro_shoot != null) DOTween.Kill(intro_shoot); if (intro_goal != null) DOTween.Kill(intro_goal); } void Start() { if (tutorialModeEnabled) { NetManager.StopNetworkingForSceneChange(); NetworkManager.singleton.networkAddress = "localhost"; NetworkManager.singleton.StartHost(); WireIntroButtons(); HideIntroImmediate(intro_goal); HideIntroImmediate(intro_shoot); StartCoroutine(SetupAiWhenReady()); StartCoroutine(ShowShootIntroWhenReady()); } } void WireIntroButtons() { if (intro_shoot != null) _introShootButton = intro_shoot.GetComponentInChildren