public static bool TryPopulateOrAdd(string name, GameObject newGameObject, GameObject oldGameObject) { UiInterfaceObject uiInterfaceObject; newGameObject.name = name; if (InterfaceObjects.TryGetValue(name, out uiInterfaceObject)) { Logger.AppendLine($"UiInterfaceObject:{name}, recall positions, LocalPosX:{uiInterfaceObject.LocalPositionX} LocalPosY:{uiInterfaceObject.LocalPositionY} LocalPosZ:{uiInterfaceObject.LocalPositionZ}"); newGameObject.transform.localPosition = new Vector3(uiInterfaceObject.LocalPositionX, uiInterfaceObject.LocalPositionY, uiInterfaceObject.LocalPositionZ); newGameObject.transform.localScale = new Vector3(uiInterfaceObject.LocalScaleX, uiInterfaceObject.LocalScaleY, uiInterfaceObject.LocalScaleZ); newGameObject.transform.localRotation = new Quaternion(uiInterfaceObject.LocalRotationX, uiInterfaceObject.LocalRotationY, uiInterfaceObject.LocalRotationZ, uiInterfaceObject.LocalRotationW); newGameObject.transform.rotation = new Quaternion(uiInterfaceObject.RotationX, uiInterfaceObject.RotationY, uiInterfaceObject.RotationZ, uiInterfaceObject.RotationW); return(true); } Logger.AppendLine($"UiInterfaceObject:{name}, wasn't there adding new"); var newObject = new UiInterfaceObject(name, oldGameObject); InterfaceObjects.Add(name, newObject); WriteConfig(); return(false); }
public static void UpdateOrAdd(string name, GameObject newGameObject) { var newObject = new UiInterfaceObject(name, newGameObject); InterfaceObjects[name] = newObject; WriteConfig(); }
public static bool TryPopulateOrAdd(string name, GameObject newGameObject, GameObject oldGameObject) { UiInterfaceObject uiInterfaceObject; newGameObject.name = name; if (InterfaceObjects.TryGetValue(name, out uiInterfaceObject)) { Logger.AppendLine($"UiInterfaceObject:{name}, recall positions, LocalPosX:{uiInterfaceObject.LocalPositionX} LocalPosY:{uiInterfaceObject.LocalPositionY} LocalPosZ:{uiInterfaceObject.LocalPositionZ}"); newGameObject.transform.localPosition = new Vector3(uiInterfaceObject.LocalPositionX, uiInterfaceObject.LocalPositionY, uiInterfaceObject.LocalPositionZ); newGameObject.transform.localScale = new Vector3(uiInterfaceObject.LocalScaleX, uiInterfaceObject.LocalScaleY, uiInterfaceObject.LocalScaleZ); newGameObject.transform.localRotation = new Quaternion(uiInterfaceObject.LocalRotationX, uiInterfaceObject.LocalRotationY, uiInterfaceObject.LocalRotationZ, uiInterfaceObject.LocalRotationW); newGameObject.transform.rotation = new Quaternion(uiInterfaceObject.RotationX, uiInterfaceObject.RotationY, uiInterfaceObject.RotationZ, uiInterfaceObject.RotationW); return true; } Logger.AppendLine($"UiInterfaceObject:{name}, wasn't there adding new"); var newObject = new UiInterfaceObject(name, oldGameObject); InterfaceObjects.Add(name, newObject); WriteConfig(); return false; }