private selectionState _selectionState = selectionState.normal; // Никак не использую эти состояния. Возможно они и не нужны.

    private void Awake()
    {
        _renderer           = GetComponent <SpriteRenderer>();
        _selfTransform      = GetComponent <Transform>();
        _playerTransform    = GameObject.Find("PlayerOLD").transform;
        _UI_Panel           = GameObject.Find("TooltipPanelOLD").GetComponent <UI_Update>();
        _environmentDisplay = GetComponent <EnvironmentDisplay>();
    }
Example #2
0
 private void Awake()
 {
     _renderer        = GetComponent <SpriteRenderer>();
     _selfTransform   = GetComponent <Transform>();
     _playerTransform = GameObject.Find("PlayerOLD").transform;
     _UI_Panel        = GameObject.Find("TooltipPanelOLD").GetComponent <UI_Update>();
     _itemDisplay     = GetComponent <ItemDisplay>();
     _inventory       = _playerTransform.GetComponent <InventoryOLD>();
 }
Example #3
0
 private void Awake()
 {
     _camera           = Camera.main;
     _xRefResolution   = GameObject.Find("Canvas").GetComponent <CanvasScaler>().referenceResolution.x;
     _RTSelf           = GetComponent <RectTransform>();
     _RTInventoryPanel = GameObject.Find("InventoryOLD").GetComponent <RectTransform>();
     _imgSelf          = GetComponent <Image>();
     _imgSlotForDrag   = RT_slotForDrag.GetComponent <Image>();
     _UI_Panel         = GameObject.Find("TooltipPanelOLD").GetComponent <UI_Update>();
     _inventory        = GameObject.Find("PlayerOLD").GetComponent <InventoryOLD>();
 }
Example #4
0
    private void Awake()
    {
        _thisRenderer    = GetComponent <SpriteRenderer>();
        _thisAnimator    = GetComponent <Animator>();
        _thisTransform   = GetComponent <Transform>();
        _playerTransform = GameObject.Find("PlayerOLD").transform;
        _player          = _playerTransform.GetComponent <PlayerOLD>();
        _UI_Panel        = GameObject.Find("TooltipPanelOLD").GetComponent <UI_Update>();

        _ahClose = Animator.StringToHash("Close");
        _ahOpen  = Animator.StringToHash("Open");
    }
Example #5
0
    private void Awake()
    {
        if (Instance == null)
        {                    // Экземпляр менеджера был найден
            Instance = this; // Задаем ссылку на экземпляр объекта

            IsPaused = false;
            text     = GetComponentInChildren <Text>();
        }
        else if (Instance != null)
        {                        // Экземпляр объекта уже существует на сцене
            Destroy(gameObject); // Удаляем объект
            Debug.LogWarning("More than one instances");
            return;
        }
    }
Example #6
0
    private void Awake()
    {
        if (gm == null)
        {
            gm = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster>();
        }
        //  reference check
        if (playerPrefab == null)
        {
            Debug.LogError("GAME MASTER: No player prefab referenced!");
        }
        if (gameOverUI == null)
        {
            Debug.LogError("GAME MASTER: No gameOverUI referenced!");
        }

        ui = GameObject.Find("UI_Overlay").GetComponent <UI_Update>();
        if (ui == null)
        {
            Debug.LogError("GAME MASTER: No UI_Overlay referenced, or no UI_Update script found !");
        }
        gameScore = 0;
    }