public virtual bool Validate(EZScreenPlacement sp) { if (sp.relativeTo.horizontal != EZScreenPlacement.HORIZONTAL_ALIGN.OBJECT && sp.relativeTo.vertical != EZScreenPlacement.VERTICAL_ALIGN.OBJECT) { sp.relativeObject = null; } if (sp.relativeObject != null && !EZScreenPlacement.TestDepenency(sp)) { TsLog.LogError(string.Concat(new string[] { "ERROR: The Relative Object you recently assigned on \"", sp.name, "\" which points to \"", sp.relativeObject.name, "\" would create a circular dependency. Please check your placement dependencies to resolve this." }), new object[0]); sp.relativeObject = null; } return(true); }
public virtual bool Validate(EZScreenPlacement sp) { // Only allow assignment of a relative object IF // we intend to use it: if (sp.relativeTo.horizontal != EZScreenPlacement.HORIZONTAL_ALIGN.OBJECT && sp.relativeTo.vertical != EZScreenPlacement.VERTICAL_ALIGN.OBJECT) { sp.relativeObject = null; } // See if our dependency is circular: if (sp.relativeObject != null) { if (!EZScreenPlacement.TestDepenency(sp)) { Debug.LogError("ERROR: The Relative Object you recently assigned on \"" + sp.name + "\" which points to \"" + sp.relativeObject.name + "\" would create a circular dependency. Please check your placement dependencies to resolve this."); sp.relativeObject = null; } } return(true); }