private void OnDestroy() { if (Instance) { Instance = null; } }
void Start() { Time.timeScale = 1; tutorialBehaviour = FindObjectOfType <TutorialBehaviour>(); InputManager.SubscribeToTouchBegin(OnTouchBegin); try { HApi.Gameplay.OnGameContinue += OnGameContinue; HApi.Gameplay.OnGamePause += OnGamePaused; HApi.Economy.OnCustomizationItemActivated += OnCustomizationItemActivated; HApi.Development.AddCustomDevAction("Toggle godmode", TogglePlayerImmortality); HApi.Development.AddCustomDevAction("ForceSkipLevels", ForceSkipLevels); saveGame = HApi.Gameplay.GetCustomSave <SaveGame>(); gamesPlayed = HApi.Utils.GetGamesPlayedCount(); var values = new float[] { AverageGalaxies, saveGame.LifetimeBestGalaxy }; var wages = new[] { CustomAdsConfig.Ref.AverageGalaxyWage, CustomAdsConfig.Ref.BestGalaxyWage }; float sum = values.Select((t, i) => t * wages[i]).Sum(); GalaxiesToSkip = Mathf.Max(1, Mathf.FloorToInt(sum / wages.Sum())); TryShowSkipGalaxiesButton(); } catch (Exception e) { Debug.LogWarning(e); } }
private void Start() { if (!Instance) { Instance = this; } renderer = GetComponentsInChildren <Renderer>(); ChangeMaterial(); }
public void SetInitials(TutorialBehaviour tutor, TutoBatBehaviour bat) { tutoBehaviour = tutor; batBehaviour = bat; }
protected override void Awake() { tutoKnight = GameObject.Find("TutoKnight").GetComponent <TutorialBehaviour> (); base.Awake(); }