示例#1
0
 private void OnDestroy()
 {
     if (Instance)
     {
         Instance = null;
     }
 }
示例#2
0
        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);
            }
        }
示例#3
0
    private void Start()
    {
        if (!Instance)
        {
            Instance = this;
        }

        renderer = GetComponentsInChildren <Renderer>();
        ChangeMaterial();
    }
示例#4
0
 public void SetInitials(TutorialBehaviour tutor, TutoBatBehaviour bat)
 {
     tutoBehaviour = tutor;
     batBehaviour  = bat;
 }
示例#5
0
 protected override void Awake()
 {
     tutoKnight = GameObject.Find("TutoKnight").GetComponent <TutorialBehaviour> ();
     base.Awake();
 }