public void RestoreState(object state)
    {
        SerializeableVector3 pos = (SerializeableVector3)state;

        if (pos != null)
        {
            transform.position = pos.GetVector3();
        }
    }
Example #2
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;
        }
        public CheckForCollision_BlueprintData(CheckForCollisionCondition condition)
        {
            this.name = condition.transform.name;

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

            this.allowedTags = condition.allowedTags;

            BoxCollider collider = condition.GetComponent <BoxCollider>();

            if (collider != null)
            {
                this.ceneter = collider.center;
                this.size    = collider.size;
            }
        }
        public TerrainModification_BlueprintData(TerrainModificationCondition condition)
        {
            this.name = condition.transform.name;

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

            this.revertOnDestroy  = condition.revertOnDestroy;
            this.modificationType = condition.modificationType;
            this.xScale           = condition.xScale;
            this.zScale           = condition.zScale;

            this.offset = condition.offset;

            this.assingAlphaMaps  = condition.assignTextureOnFlattenArea;
            this.alphaMap         = condition.flattenAreaTextureIndex;
            this.alphaMapStrength = condition.flattenAreaTextureStrength;
        }