Last change
on this file since 29968 was 29634, checked in by bmt11, 9 years ago |
All weather is now functioning including switching back to fine weather. Weather is now also affected by wind force
|
File size:
624 bytes
|
Rev | Line | |
---|
[29475] | 1 |
|
---|
| 2 | function weatherSystem(scene){
|
---|
| 3 |
|
---|
| 4 | this.scene = scene;
|
---|
| 5 | this.s = false;
|
---|
| 6 | this.type = null;
|
---|
| 7 |
|
---|
| 8 | this.set = function(weather){
|
---|
| 9 | this.s = true;
|
---|
| 10 | this.type = weather;
|
---|
| 11 | weather.init();
|
---|
| 12 | this.scene.add(this.getWeather());
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 | this.getWeather = function(){
|
---|
| 16 | return this.type.system();
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | this.update = function(){
|
---|
| 20 | this.type.update();
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | this.swap = function(w){
|
---|
| 24 | if(this.type != w){
|
---|
[29634] | 25 | if(this.type !== null){
|
---|
| 26 | this.scene.remove(this.getWeather());
|
---|
| 27 | }
|
---|
[29475] | 28 | this.set(w);
|
---|
| 29 | }
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | this.isSet = function(){
|
---|
| 33 | return this.s;
|
---|
| 34 | }
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 |
|
---|
| 38 |
|
---|
| 39 |
|
---|
| 40 |
|
---|
| 41 |
|
---|
| 42 | |
---|
Note:
See
TracBrowser
for help on using the repository browser.