Пример #1
0
        public override void Init()
        {
            cam           = GameController.instance.GetCameraController();
            worldUiCanvas = GameController.instance.sceneController.worldUiCanvas;
            scale         = 1;

            curElement = worldUiCanvas.SpawnUi(uiPrefab, type);
            if (curElement == null)
            {
                throw new WorldspaceUiSpawnException();
            }

            if (scaleFromParent)
            {
                scale = transform.localScale.x;
            }

            if (target == null)
            {
                target = transform;
                // Try to up over head
                scale *= 2.3f;
            }

            inited = true;
            curElement.SetActive(false);
        }
 public void SpawnWorldUiCanvas()
 {
     if (worldUiCanvas == null)
     {
         worldUiCanvas = Instantiate(GameManager.Instance().worldUiCanvasGameObject).GetComponent <WorldUiCanvas>();
     }
 }
 public void LoadScene(int scene)
 {
     isLoading     = true;
     worldUiCanvas = null;
     loadingScreen.Show();
     sceneLoadingOperation            = SceneManager.LoadSceneAsync(scene, LoadSceneMode.Single);
     sceneLoadingOperation.completed += OnLoaded;
 }
Пример #4
0
        public void Init()
        {
            worldUiCanvas         = GameController.instance.sceneController.worldUiCanvas;
            stats                 = GetComponent <IHealthable>();
            stats.OnHealthChange += ShowHealChange;
            stats.OnHealthChange += ShowDamageText;
            target                = transform;
            Transform targetRend = GetComponentInChildren <Transform>();

            if (targetRend != null)
            {
                target = targetRend.transform;
            }
        }
Пример #5
0
 private void SpawnWorldUiCanvas()
 {
     worldUiCanvas = Instantiate(GameController.instance.worldUiCanvasGameObject).GetComponent <WorldUiCanvas>();
 }