Beispiel #1
0
    private float _moveTime;                                        // wird zweimal ausgefuehrt, bei Auf- und Abwaertsbewegung

    // Use this for initialization
    void Start()
    {
        _gameObserver = GetComponent <PlayfieldObserver>();
        _boardInfo    = GetComponent <PlayfieldInitialiser>();

        //_idleTime = _trapAnimationTime / 2;
        //_moveTime = (_trapAnimationTime - _idleTime) / 2;
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        _boardObserver = GameObject.Find("boardGameManager").GetComponent <PlayfieldObserver>();

        _timerText      = GetComponent <Text>();
        _timerText.text = ShowRemainingTime();
        _textColor      = _timerText.color;
    }
Beispiel #3
0
    private void OnEnable()
    {
        Vector3 camOffset_V = new Vector3(0f, 15f, -10f);

        gameObject.GetComponent <Camera>().orthographic = false;
        _player       = GameObject.Find("Player");
        _gameObserver = GameObject.Find("boardGameManager").GetComponent <PlayfieldObserver>();
        transform.SetParent(_player.transform);
        transform.localPosition = camOffset_V;
        transform.rotation      = Quaternion.Euler(new Vector3(40f, 0f, 0f));
    }
    // Use this for initialization
    void Start()
    {
        _boardManager = GameObject.Find("boardGameManager").transform;
        _boardInfo    = _boardManager.GetComponent <PlayfieldInitialiser>();
        _gameObserver = _boardManager.GetComponent <PlayfieldObserver>();

        _mainCamera = GameObject.Find("Main Camera").GetComponent <Camera>();

        anim = gameObject.GetComponent <Animator>();
        rb   = gameObject.GetComponent <Rigidbody>();

        //m_resetPointV wird in initPlayfield initialisiert
        _stepForward = _boardInfo.TileHeight;
        _stepSide    = _boardInfo.TileWidth;

        CanMove = false;
    }
Beispiel #5
0
    private float _destroyTimer = 0f;                                   // zaehlt die Zeit hoch, bis die Hilfe nicht mehr angezeigt wird

    // Use this for initialization
    void Start()
    {
        _mainCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
        _mainCamera.GetComponent <ThirdPersonCamera>().enabled = false;
        _mainCamera.orthographic = true;                                // _displayField ist besser erkennbar
        _gameObserver            = gameObject.GetComponent <PlayfieldObserver>();

        _pathUI       = GameObject.Find("Canvas").GetComponent <ShowPathUI>();
        _displayField = new GameObject("displayField");

        _tileSize          = TileSprite.bounds.size.x + OFFSET;
        _displayFieldWidth = (_gameObserver.GetPlayfieldWidth() * _tileSize) - OFFSET;  // Breite der Anzeige - letztes OFFSET nach dem letzten Tile wird abgezogen
        //float displayScale = (_pathUI.PhoneImage.rectTransform.rect.width / 100 - 0.3f) / _displayFieldWidth; // Pixel des Smartphones in Units umrechnen
        float displayScale = (_pathUI.PhoneImage.transform.Find("BackgroundImage").GetComponent <RectTransform>().rect.width / 100 - 0.5f) / _displayFieldWidth;

        _displayField.transform.localScale = new Vector3(displayScale, displayScale, 1f);

        GenerateSprites(_gameObserver.GetPlayfieldHeight(), _gameObserver.GetPlayfieldWidth());
        coroutineDisplay = DisplayPath();

        // zur Kamera verschieben
        Vector3 pos = new Vector3(
            (0 + TileSprite.bounds.size.x * displayScale / 2) - (_displayFieldWidth * displayScale / 2),
            _mainCamera.transform.position.y - 3,
            1
            );

        _displayField.transform.position = pos;

        // Audio fuer das Ende einstellen
        Audio             = _displayField.AddComponent <AudioSource>();
        Audio.clip        = AudioComplete;
        Audio.playOnAwake = false;
        Audio.volume      = 0.5f;

        // Pfad anzeigen lassen
        StartCoroutine(StartDisplay());
    }
 // Use this for initialization
 void Start()
 {
     _player       = GameObject.Find("Player");
     _gameObserver = GameObject.Find("boardGameManager").GetComponent <PlayfieldObserver>();
 }