Ejemplo n.º 1
0
    void OnInitialize()
    {
        _uiItem = Instantiate(_uiPrefab, WorldUIManager.getInstance.canvas);
        _uiItem.transform.Find("text").GetComponent <Text>().text = "[Unknown Signal]";

        _uiItem.GetComponent <GenericTooltipHandler>().Initialize(
            null,   //should bring up tooltip
            delegate
        {
            CommandMapper.AddMove(_entity.transform.position, !Input.GetKey(KeyCode.LeftShift));

            if (_isDiscovered)
            {
                CommandMapper.SetResourceTarget(_entity);
            }
        },
            delegate
        {
            if (Input.GetKey(KeyCode.LeftAlt))
            {
                CommandMapper.SetAlignmentPlane(_entity.transform.position.y);
            }
            else
            {
                CameraManager.getInstance.JumpTo(_entity.transform.position, true);
            }
        },
            null,
            null);  //should kill tooltip

        InitializeAlignmentVisualization();
    }