displayList might be null

This commit is contained in:
Rex 2024-04-08 00:36:59 +08:00
parent 266c1f411d
commit f9cf19f479

View file

@ -97,7 +97,15 @@ var Depth = {
*/
bringMeToTop: function()
{
var list = (this.parentContainer) ? this.parentContainer.list : this.displayList.list;
var list;
if (this.parentContainer)
{
list = this.parentContainer.list;
}
else if (this.displayList)
{
list = this.displayList.list;
}
if (!list)
{
@ -118,7 +126,15 @@ var Depth = {
*/
sendMeToBack: function()
{
var list = (this.parentContainer) ? this.parentContainer.list : this.displayList.list;
var list;
if (this.parentContainer)
{
list = this.parentContainer.list;
}
else if (this.displayList)
{
list = this.displayList.list;
}
if (!list)
{
@ -142,7 +158,15 @@ var Depth = {
*/
moveMyDepthBelow: function(gameObject)
{
var list = (this.parentContainer) ? this.parentContainer.list : this.displayList.list;
var list;
if (this.parentContainer)
{
list = this.parentContainer.list;
}
else if (this.displayList)
{
list = this.displayList.list;
}
if (!list)
{
@ -166,7 +190,15 @@ var Depth = {
*/
moveMyDepthAbove: function(gameObject)
{
var list = (this.parentContainer) ? this.parentContainer.list : this.displayList.list;
var list;
if (this.parentContainer)
{
list = this.parentContainer.list;
}
else if (this.displayList)
{
list = this.displayList.list;
}
if (!list)
{