When moving a disabled (gameObject.SetActive(false)) RectTransform, the 2017.x releases don't behave the same as 5.6.x did.
I'm setting the RectTransform offsetMin and offsetMax via script here (while the RT is disabled) and as you can see, the inspector 'thinks' the rect is moving (the outline and RectTransform position data in the editor are updating) but the RT isn't physically moving on my screen. This bug isn't limited to the editor only however, same visible results in actual builds.
Here's how it SHOULD look (and the exact same code worked like this in 5.6.x):
Seems like a pretty ugly bug... is this a known issue? Got a simple repro project case if it's worthwhile logging a bug, but hoping there's some justice in the world and I'm not the first to hit this.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TestPos : MonoBehaviour {
int pos;
float t;
[SerializeField]
RectTransform rt;
void Start () {
this.pos = 4;
this.t = -100;
}
void Update () {
if (Time.realtimeSinceStartup - this.t < 1) return;
this.t = Time.realtimeSinceStartup;
this.pos += 1;
if (this.pos == 5) this.pos = 1;
this.rt.gameObject.SetActive(false);
if (this.pos == 1) {
this.rt.offsetMin = Vector2.zero;
this.rt.offsetMax = new Vector2(100, 100);
}
if (this.pos == 2) {
this.rt.offsetMin = new Vector2(0, Screen.height - 100);
this.rt.offsetMax = new Vector2(100, Screen.height);
}
if (this.pos == 3) {
this.rt.offsetMin = new Vector2(Screen.width - 100, Screen.height - 100);
this.rt.offsetMax = new Vector2(Screen.width, Screen.height);
}
if (this.pos == 4) {
this.rt.offsetMin = new Vector2(Screen.width - 100, 0);
this.rt.offsetMax = new Vector2(Screen.width, 100);
}
this.rt.gameObject.SetActive(true);
}
}