private void OnTriggerEnter(Collider collidedObj) { var temp = collidedObj.GetComponent <WaterRipples>(); if (temp != null) { waterRipples = temp; } else { return; } canUpdate = true; reversedVelocityQueue.Clear(); triggeredTime = Time.time; fadeInVelocity = 1; if (SplashAudioSource != null) { SplashAudioSource.Play(); } if (SplashEffect != null) { var offset = waterRipples.GetOffsetByPosition(t.position); offset.x = t.position.x; offset.z = t.position.z; var splash = Instantiate(SplashEffect, offset, new Quaternion()); Destroy(splash, 2); } UpdateMovedSplash(); }
public Player(Program owner) { this.owner = owner; this.wind = owner.Weather.Wind; // Set the wind wind.Direction = 0; wind.DirectionVariance = 0.3; useAileronForRudder = Convert.ToBoolean(Bonsai.Utils.Settings.GetValue("UseAileronChannel")); UpdateExpos(); Bonsai.Utils.Settings.SettingsChanged += new Bonsai.Utils.Settings.SettingsEventHandler(Settings_SettingsChanged); debugObject = new GameObject(); CubeMesh debugCube = new CubeMesh(0.1f); debugCube.Texture = new Bonsai.Objects.Textures.TextureBase("data\\grass.jpg"); debugObject.Mesh = debugCube; towLine = new LineMesh(); windVector = new LineMesh(); ripples = new WaterRipples(); reflection = new Reflection(); //normalObject = new GameObject(); //normalObject.Mesh = terrainNormal; }
void OnTriggerEnter(Collider collidedObj) { var temp = collidedObj.GetComponent <WaterRipples>(); if (temp != null) { waterRipples = temp; } }
//void OnTriggerExit() //{ // waterRipples = null; // canUpdate = false; //} void OnEnable() { waterRipples = null; canUpdate = false; if (splashMovedInstance != null) { Destroy(splashMovedInstance); } }
private void Generator() { List <WaterForce.Data> data = new List <WaterForce.Data> { new WaterForce.Data { Position = base.transform.position, Force = this._Force * Mathf.Cos(Time.timeSinceLevelLoad * this._Speed) } }; WaterRipples.AddForce(data, this._Radius); }
void OnTriggerEnter(Collider collidedObj) { var temp = collidedObj.GetComponent <WaterRipples>(); if (temp != null && temp.isActiveAndEnabled) { waterRipples = temp; if (OnSplashOnWater != null) { OnSplashOnWater(this.gameObject); } } }
/// <summary> /// Clean up. /// </summary> public void Dispose() { Bonsai.Utils.Settings.SettingsChanged -= new Bonsai.Utils.Settings.SettingsEventHandler(Settings_SettingsChanged); if (iFlightModel != null) { iFlightModel.Dispose(); iFlightModel = null; } if (modelApi != null) { modelApi.Dispose(); modelApi = null; } if (smoke != null) { smoke.Dispose(); smoke = null; } if (airplane != null) { airplane.Dispose(); airplane = null; } if (variometer != null) { variometer.Dispose(); variometer = null; } if (towLine != null) { towLine.Dispose(); towLine = null; } if (windVector != null) { windVector.Dispose(); windVector = null; } if (ripples != null) { ripples.Dispose(); ripples = null; } if (reflection != null) { reflection.Dispose(); reflection = null; } }
/// <summary> /// Clean up. /// </summary> public void Dispose() { if (smoke != null) { smoke.Dispose(); smoke = null; } if (airplaneModel != null) { airplaneModel.Dispose(); airplaneModel = null; } if (ripples != null) { ripples.Dispose(); ripples = null; } }
//void OnTriggerExit() //{ // waterRipples = null; // canUpdate = false; //} void OnEnable() { waterRipples = null; canUpdate = false; if (splashMovedInstance != null) { Destroy(splashMovedInstance); } }
private void OnTriggerEnter(Collider collidedObj) { var temp = collidedObj.GetComponent<WaterRipples>(); if (temp!=null) waterRipples = temp; else return; canUpdate = true; reversedVelocityQueue.Clear(); triggeredTime = Time.time; fadeInVelocity = 1; if(SplashAudioSource!=null) SplashAudioSource.Play(); if (SplashEffect!=null) { var offset = waterRipples.GetOffsetByPosition(t.position); offset.x = t.position.x; offset.z = t.position.z; var splash = Instantiate(SplashEffect, offset, new Quaternion()); Destroy(splash, 2); } UpdateMovedSplash(); }
void OnTriggerEnter(Collider collidedObj) { var temp = collidedObj.GetComponent<WaterRipples>(); if (temp!=null) waterRipples=temp; }
void OnEnable() { waterRipples = null; }
void OnEnable() { waterRipples = null; }
/// <summary> /// Constructor /// </summary> /// <param name="owner"></param> public RecordedFlight(Program owner) { this.owner = owner; this.smoke = new Smoke(owner, this); this.ripples = new WaterRipples(); }