Пример #1
0
        public override void UnPack(GameObject target)
        {
            BaseBuilding building = target.GetComponentInParent <BaseBuilding>();

            if (building != null)
            {
                CheckForGroundCondition condition = (CheckForGroundCondition)building.CreateCondition(name, SocketPositionAnchor.Center, typeof(CheckForGroundCondition));

                condition.transform.localPosition = (Vector3)position;
                condition.transform.localScale    = (Vector3)scale;
                condition.transform.localRotation = (Quaternion)rotation;

                condition.destroyDelay = this.destroyDelay;
            }
        }
Пример #2
0
        public override void UnPack(GameObject target)
        {
            BaseBuilding building = target.GetComponentInParent <BaseBuilding>();

            if (building != null)
            {
                CheckForCollisionCondition condition = (CheckForCollisionCondition)building.CreateCondition(name, SocketPositionAnchor.Center, typeof(CheckForCollisionCondition));

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

                if (collider != null)
                {
                    collider.center = (Vector3)this.ceneter;
                    collider.size   = (Vector3)this.size;
                }

                condition.transform.localPosition = (Vector3)position;
                condition.transform.localScale    = (Vector3)scale;
                condition.transform.localRotation = (Quaternion)rotation;

                condition.allowedTags = this.allowedTags;
            }
        }
        public override void UnPack(GameObject target)
        {
            BaseBuilding building = target.GetComponentInParent <BaseBuilding>();

            if (building != null)
            {
                TerrainModificationCondition condition = (TerrainModificationCondition)building.CreateCondition(name, SocketPositionAnchor.Center, typeof(TerrainModificationCondition));
                condition.transform.localPosition = (Vector3)position;
                condition.transform.localScale    = (Vector3)scale;
                condition.transform.localRotation = (Quaternion)rotation;

                condition.revertOnDestroy  = this.revertOnDestroy;
                condition.modificationType = this.modificationType;
                condition.xScale           = this.xScale;
                condition.zScale           = this.zScale;
                condition.offset           = (Vector3)this.offset;

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