Beispiel #1
0
    private void Start()
    {
        _delay     = Random.Range(1f, 3f);
        startPos   = new Vector3() + transform.position;
        startScale = new Vector3() + transform.lossyScale;

        _collider = GetComponent <BoxCollider>();
        KillZone.Instance().BindOnDieEvent(Rise);
    }
    private KillZone GetKillzone()
    {
        if (_killZone == null)
        {
            _killZone = KillZone.Instance();
        }

        return(_killZone);
    }
    private void Awake()
    {
        _playerSpawn  = PlayerSpawn.Instance();
        _finish       = Finish.Instance();
        _camera       = Instantiate(_cameraGameObject, _finish.transform.position + CameraOffset, Quaternion.Euler(CameraRotation)).GetComponent <Camera>();
        _followPlayer = _camera.GetComponent <FollowPlayer>();
        KillZone.Instance().BindOnDieEvent(ShowRespawn);


        SpawnPlayer();

        _playerMovement = _playerPawn.GetComponent <PlayerMovement>();
        _respawnCamPos  = RespawnCameraLocation.Instance().transform.position;

        _camera.transform.DOMove(_playerSpawn.transform.position + CameraOffset, 4).SetDelay(2f).OnComplete(gameStart).Play();
    }
Beispiel #4
0
 private void Start()
 {
     KillZone.Instance().BindOnDieEvent(() => { gameObject.SetActive(true); });
 }
Beispiel #5
0
 private void Start()
 {
     KillZone.Instance().BindOnDieEvent(() => { items.Clear(); });
 }