Inheritance: MonoBehaviour
Exemplo n.º 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);
    }
Exemplo n.º 2
0
    private KillZone GetKillzone()
    {
        if (_killZone == null)
        {
            _killZone = KillZone.Instance();
        }

        return(_killZone);
    }
Exemplo n.º 3
0
    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();
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     trfm = GetComponent <Transform>();
     rb   = GetComponent <Rigidbody2D>();
     bc2d = GetComponent <BoxCollider2D>();
     if (mayKill)
     {
         killZone            = killZoneTrfm.GetComponent <KillZone>();
         killZoneCol         = killZoneTrfm.GetComponent <BoxCollider2D>();
         killZoneCol.enabled = false;
         killDelay          /= 1000;
         killZone.kinematic  = this;
     }
     expansionTime += 1;
     expansionTime /= 1000;
     delay         /= 1000;
     delayAtEnd    /= 1000;
 }
Exemplo n.º 5
0
 private void Start()
 {
     KillZone.Instance().BindOnDieEvent(() => { gameObject.SetActive(true); });
 }
 public void addKillZone(KillZone zone)
 {
     this.killZones.Add(zone);
 }
Exemplo n.º 7
0
 private void Start()
 {
     KillZone.Instance().BindOnDieEvent(() => { items.Clear(); });
 }