Beispiel #1
0
    private void Start()
    {
        _rewinder = GameObject.Find("__Scene__").GetComponent <Rewinder>();
        Core      = GetComponent <PlayerCore>();

        WorldUIManager.DisplayBanner(WorldUiElement.LeftBanner);
        UpdateRewindsCountBanner(_rewindsLeft);
        StartCoroutine(DelayTeleport());
    }
Beispiel #2
0
 private void Awake()
 {
     Instance = this;
     foreach (ResourceCounter counter in GetComponentsInChildren <ResourceCounter>())
     {
         _counters.Add(counter.Type, counter);
         counter.ResourceText.text = "0";
     }
 }
Beispiel #3
0
    private void Awake()
    {
        if (_instance != null)
        {
            return;
        }

        _instance = this;
        Init();
    }
Beispiel #4
0
 private void OnEnable()
 {
     rts_HPBar.gameObject.SetActive(true);
     if (rts_HPBar.parent == transform)
     {
         rts_HPBar.SetParent(WorldUIManager.Get().canvas_UnitHPBar.transform, true);
         rts_HPBar.localRotation = Quaternion.identity;
         rts_HPBar.localScale    = Vector3.one;
     }
 }
Beispiel #5
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
    public static void Initialize()
    {
        GameManager.OnShipDestroyed += OnShipDestroyed;

        _camera        = Camera.main;
        _uiManager     = WorldUIManager.getInstance;
        _cameraManager = CameraManager.getInstance;

        _selectedShips = new List <ShipEntity>();
        _uiManager.Initialize();
    }
Beispiel #7
0
 //This method ensures there is only 1 instance of the object
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         if (instance != this)
         {
             Destroy(gameObject);
         }
     }
     //DontDestroyOnLoad(gameObject);
 }
Beispiel #8
0
    // Private

    private void DisplayDeathUI(bool hasRewindsLeft)
    {
        WorldUIManager.DisplayBanner(WorldUiElement.MainBanner);
        WorldUIManager.DisplayBanner(WorldUiElement.SubBanner);

        if (hasRewindsLeft)
        {
            WorldUIManager.SetBannerText(WorldUiElement.MainBanner, "Try That Again");
            WorldUIManager.SetBannerText(WorldUiElement.SubBanner, "Hold L1 or Backspace to rewind.");
        }
        else
        {
            WorldUIManager.SetBannerText(WorldUiElement.MainBanner, "Out of Rewinds");
            WorldUIManager.SetBannerText(WorldUiElement.SubBanner, "Hold L1 or Backspace restart at checkpoint.");
        }
    }
Beispiel #9
0
    private IEnumerator RewindEndingCountdownUi()
    {
        WorldUIManager.DisplayBanner(WorldUiElement.SubBanner);

        var timeWaitedForResume = 0f;

        while (true)
        {
            // Banner will exit when status changes for any reason
            if (_currentRewindStatus != RewindStatus.SafeFreeze && timeWaitedForResume > 0)
            {
                break;
            }

            var countdown = Math.Round((Rewinder.WaitBeforeResumeTime - timeWaitedForResume), 1);
            countdown = countdown < 0 ? 0 : countdown;
            WorldUIManager.SetBannerText(WorldUiElement.SubBanner, countdown.ToString());
            timeWaitedForResume += Time.deltaTime;

            yield return(null);
        }

        WorldUIManager.HideElement(WorldUiElement.SubBanner);
    }
Beispiel #10
0
 private void UpdateRewindsCountBanner(int rewindsCount)
 {
     WorldUIManager.SetBannerText(WorldUiElement.LeftBanner, $"Rewinds: {rewindsCount}");
 }
Beispiel #11
0
 private void HideDeathUI()
 {
     WorldUIManager.HideElement(WorldUiElement.MainBanner);
     WorldUIManager.HideElement(WorldUiElement.SubBanner);
 }
 void Awake()
 {
     uiManager = FindObjectOfType<UIManager>();
     worldUI = FindObjectOfType<WorldUIManager>();
     pauseManager = GetComponentInChildren<PauseManager>();
     avatar = GameObject.FindGameObjectWithTag(Tags.Avatar).GetComponent<AvatarBehaviour>();
 }
 void Awake()
 {
     _instance = this;
 }