private void InitAllMirror() { GameObject right = GameObject.Find("root_right"); right.GetComponent <MirrorBehavior>().SetMirror(true); foreach (Transform g in right.transform) { MirrorBehavior m = g.GetComponent <MirrorBehavior>(); if (m) { m.SetMirror(true); } } IterInitMirror(right.transform, null); }
private void ResetMirrorData(GameObject left, GameObject right, bool is_right) { Vector3 mirror_map = new Vector3(-1, 1, 1); Vector3 pos = right.transform.position; pos.Scale(mirror_map); left.transform.position = pos; Vector3 scale = right.transform.localScale; scale.Scale(mirror_map); left.transform.localScale = scale; left.GetComponent <MirrorBehavior>().SetMirror(is_right); foreach (Transform g in left.transform) { MirrorBehavior m = g.GetComponent <MirrorBehavior>(); if (m) { m.SetMirror(is_right); } } }