Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (isDead == true)
        {
            transform.position -= new Vector3(0, 1, 0) * Time.deltaTime * squeeze;
            duration           -= Time.deltaTime;
            if (duration <= 0)
            {
                squeeze = .5f;
                isDead  = false;
                _respawnController.Respawn();
            }
        }
        if (isDelaying == true)
        {
            squeeze += Time.deltaTime;

            delay -= Time.deltaTime;
            transform.position -= new Vector3(0, 1, 0) * Time.deltaTime * squeeze * squeeze;
            if (delay <= 0)
            {
                isDelaying = false;
                gameObject.GetComponent <Rigidbody>().isKinematic = false;
                foo = true;
                bar = .1f;
            }
        }
        if (foo == true)
        {
            gameObject.GetComponent <Rigidbody>().velocity = (new Vector3(0, -1, 0) * force);
            foofoo = true;
            foo    = false;
        }
    }
 private void OnTriggerStay(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         other.GetComponent <PlayerMove>().enabled = false;
         RespawnController.Respawn(other.gameObject);
         other.GetComponent <PlayerMove>().enabled = true;
     }
 }