Example #1
0
File: Lift.cs Project: ooryase/Neko
    public void PlayerFree()
    {
        bind = false;
        player.GetComponent <Rigidbody>().useGravity = true;

        playerFollow.Shake(1.2f);
        playerFollow.SetFollowSpeed(0.7f);

        if (source.isPlaying)
        {
            source.Stop();
        }
        source.PlayOneShot(drop);
    }
Example #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag != "Player")
        {
            return;
        }

        myCamera.Shake(0.3f);
        source.PlayOneShot(source.clip);
        for (int i = 0; i < 2; i++)
        {
            var r = Instantiate(rock, rock.transform.position + new Vector3(Random.Range(-1.0f, 1.0f), Random.Range(0, 5.0f), 0), Quaternion.Euler(Random.Range(0, 180), 90.0f, 270.0f));
            r.GetComponent <Rigidbody>().useGravity = true;
            r.GetComponent <AudioSource>().Play();
            rocks.Add(r);
        }
    }
Example #3
0
 void Shake()
 {
     playerFollow.Shake(0.3f);
 }