// Update is called once per frame
 void Update()
 {
     if (Time.time > nextJiggle)
     {
         mj.Splash(mj.GetRandomVertex(), Vector3.one * (baseForce + Random.Range(0, forceVariance)), jiggleRadius);
         nextJiggle += timeBetweenJiggles;
     }
 }
Beispiel #2
0
    public void OnCollisionInfo(LogicEntity e, RaycastCollisionInfo info)
    {
        if (info.horizontalEntered)
        {
            jiggler.Splash(
                e.position.value.ToVector3(),
                e.lastVelocity.value.ToVector3() / 200,
                10
                );
        }

        if (info.verticalEntered)
        {
            jiggler.Splash(
                e.position.value.ToVector3(),
                e.lastVelocity.value.ToVector3() / 200,
                10
                );
        }

        if (info.horizontalExited)
        {
            jiggler.Splash(
                e.position.value.ToVector3(),
                e.lastVelocity.value.ToVector3() / 200,
                10
                );
        }

        if (info.VerticalExited)
        {
            jiggler.Splash(
                e.position.value.ToVector3(),
                e.lastVelocity.value.ToVector3() / 200,
                10
                );
        }
    }