Example #1
0
    private void OnTriggerExit(Collider other)
    {
        IFanpPlatform fanplat = other.GetComponent <IFanpPlatform>();

        if (fanplat != null)
        {
            distance = 0;
        }
    }
Example #2
0
    private void OnTriggerStay(Collider other)
    {
        IFanpPlatform fanplat = other.GetComponent <IFanpPlatform>();

        if (fanplat != null)
        {
            float   fanDistance = calculateFanForce(other.transform.position);
            Vector3 eForce      = direction * (pushSpeed - distance * distanceMultiplier) * Time.deltaTime;

            // DO clamping if using add force
            fanplat.ApplyFanForce(eForce, maxFanSpeed);
        }
    }