@@ -88,7 +88,10 @@ class Monster3DProfile extends Component {
88
88
}
89
89
90
90
shouldComponentUpdate ( newProps , newState ) {
91
- return ! ( this . props . path === newProps . path ) ;
91
+ //return !( this.props.path === newProps.path );
92
+ //TODO find a way to update animations while update monsters
93
+ // The select element is changing when you select the same value?
94
+ return true ;
92
95
}
93
96
94
97
componentWillUnmount ( ) {
@@ -155,6 +158,9 @@ class Monster3DProfile extends Component {
155
158
this . camera . near = size / 1000
156
159
this . camera . far = size * 1000
157
160
161
+ //restart position of monster
162
+ //this.monster.position.set(0,0,0);
163
+
158
164
// set monster initial position
159
165
this . monster . position . x += ( this . monster . position . x - center . x )
160
166
this . monster . position . y += ( this . monster . position . y - center . y )
@@ -195,6 +201,8 @@ class Monster3DProfile extends Component {
195
201
196
202
// set camera initial position
197
203
this . camera . lookAt ( center )
204
+ //default camera position:
205
+ this . camera . position . set ( 0 , 0 , 0 ) ;
198
206
this . camera . position . z += size
199
207
200
208
// set camera position relative to initial position
@@ -308,10 +316,12 @@ class Monster3DProfile extends Component {
308
316
// darkens or lights the monster, and adds
309
317
// or not, the sleeping z's model.
310
318
monsterLightColor = ( action ) => {
319
+ console . log ( action ) ;
311
320
if (
312
321
action === ActionType . SLEEPING ||
313
322
action === ActionType . DEAD
314
323
) {
324
+ console . log ( "Sleeping or dead" )
315
325
this . darkenMonster ( )
316
326
if ( action !== ActionType . DEAD ) {
317
327
if ( this . sleepingObject ) {
@@ -324,6 +334,7 @@ class Monster3DProfile extends Component {
324
334
this . sleepingMixer &&
325
335
this . sleepingMixer . stopAllAction ( )
326
336
this . camera . remove ( this . sleepingObject )
337
+ console . log ( "was the Sleeping object remove?" )
327
338
}
328
339
} else {
329
340
this . lightMonster ( )
0 commit comments