Esempio n. 1
0
    void OnTriggerStay(Collider col)
    {
        inWind = IN_WIND.IN;

        // Replace get component ???
        gc = col.GetComponent <GlideController>();


        if (gc != null)
        {
            if (forceApplication == FORCE_APPLICATION.INSTANT)
            {
                gc.WindVelocity = windIntensity * transform.right;

                // high +ve values = high tailwind, high -ve = headwind, zero = wind is side-on
                float tailwind = Vector3.Dot(gc.transform.forward, transform.right) * windIntensity;
                //gc.acceleration += tailwind * Time.deltaTime * boostPercentage;
                gc.acceleration += tailwind * Time.deltaTime;
                //Debug.Log(gc.acceleration);
            }
            else if (forceApplication == FORCE_APPLICATION.SLOWLY)
            {
                if (wind < windIntensity)
                {
                    wind++;
                }

                gc.WindVelocity = wind * transform.right;

                // high +ve values = high tailwind, high -ve = headwind, zero = wind is side-on
                float tailwind = Vector3.Dot(gc.transform.forward, transform.right) * wind;
                //gc.acceleration += tailwind * Time.deltaTime * boostPercentage;
                gc.acceleration += tailwind * Time.deltaTime;
                //Debug.Log(wind);
            }
            else if (forceApplication == FORCE_APPLICATION.QUICKLY)
            {
                if (wind < windIntensity)
                {
                    wind += 3;
                }

                gc.WindVelocity = wind * transform.right;

                // high +ve values = high tailwind, high -ve = headwind, zero = wind is side-on
                float tailwind = Vector3.Dot(gc.transform.forward, transform.right) * wind;
                //gc.acceleration += tailwind * Time.deltaTime * boostPercentage;
                gc.acceleration += tailwind * Time.deltaTime;
                //Debug.Log(wind);
            }
        }
    }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     glide = GetComponent <GlideController>();
     rb    = GetComponent <Rigidbody>();
 }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     gc = GetComponent <GlideController>();
 }
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     glide = GetComponent <GlideController>();
     h     = GetComponent <Health>();
 }
Esempio n. 5
0
 // Use this for initialization
 void Start()
 {
     glide = target.transform.parent.gameObject.GetComponent <GlideController>();
 }