Exemple #1
0
    // Start is called before the first frame update
    void Start()
    {
        _term = GetComponent <TerminalBehaviour>();

        _term.Tiles.ScrambleJob().Run();
        _term.SetDirty();
    }
Exemple #2
0
    private void OnEnable()
    {
        _controls = new Controls();
        _controls.Enable();

        _lmbDrag            = _controls.Default.LMBDrag;
        _lmbDrag.performed += OnDragBegin;
        _lmbDrag.canceled  += OnDragEnd;

        _term = GetComponent <TerminalBehaviour>();
    }
Exemple #3
0
    private void OnEnable()
    {
        if (_cam == null)
        {
            _cam = GetComponent <TiledCamera>();
        }

        if (_terminal == null)
        {
            if (_terminal == null)
            {
                _terminal = FindObjectOfType <TerminalBehaviour>();
            }
        }
    }
        protected virtual void OnEnable()
        {
            _term = GetComponent <TerminalBehaviour>();
            _drag = GetComponent <DraggingControls>();
            _drag.OnPointDragged += OnPointDragged;
            _drag.OnDragEnded    += OnDragEnded;
            _drag.OnDragStarted  += OnDragStarted;

            _controls = new Controls();
            _controls.Enable();

            _addNoise = _controls.Default.AddNoise;
            _resize   = _controls.Default.ResizeMap;
            _clear    = _controls.Default.Clear;

            _map = new BasicPathingMap(_size.x, _size.y, Allocator.Persistent);
        }
Exemple #5
0
    IEnumerator Start()
    {
        // Apparently PixelPerfectCamera takes a couple frames before it starts
        // adjusting the viewport...good stuff
        yield return(null);

        yield return(null);

        _term = TerminalBehaviour.CreateAtScreenPosition("Terminal",
                                                         44, 1, posX, posY, alignX, alignY);
        _term.Print(0, 0, "The quick brown fox jumps over the lazy dog.");

        // Initial alignment fails since WithFont gets called after construction...
        _halfTerm = TerminalBehaviour.CreateAtScreenPosition("HalfTerminal",
                                                             44, 1, posX, posY, alignX, alignY).WithFont("Terminal8x16");
        _halfTerm.transform.position = Camera.main.GetAlignedViewportPosition(
            new float2(0, 1),
            new float2(1, -1),
            _halfTerm.GetWorldSize().xy);
        _halfTerm.transform.position += Vector3.down;
        _halfTerm.Print(0, 0, "The quick brown fox jumps over the lazy dog.");
    }
Exemple #6
0
 private void OnEnable()
 {
     _term = GetComponent <TerminalBehaviour>();
 }
Exemple #7
0
 private void Awake()
 {
     _term = GetComponent <TerminalBehaviour>();
 }