Ejemplo n.º 1
0
        public SocketBuildingData(BaseSocket socket)
        {
            this.name = socket.transform.name;

            this.position = socket.transform.localPosition;
            this.rotation = socket.transform.localRotation;
            this.scale    = socket.transform.localScale;

            this.receiveType = socket.receiveType;
            this.placingType = socket.placingType;

            this.center = socket.center;
            this.size   = socket.size;

            this.isHoverTarget = socket.isHoverTarget;
        }
Ejemplo n.º 2
0
        public override void UnPack(GameObject target)
        {
            BaseBuilding building = target.GetComponentInParent <BaseBuilding>();

            if (building != null)
            {
                BaseSocket socket = building.CreateSocket(name, SocketPositionAnchor.Center, null, receiveType, placingType);
                socket.transform.localPosition = (Vector3)position;
                socket.transform.localScale    = (Vector3)scale;
                socket.transform.localRotation = (Quaternion)rotation;

                socket.center = (Vector3)this.center;
                socket.size   = (Vector3)this.size;

                socket.isHoverTarget = isHoverTarget;
            }
        }