示例#1
0
        public override void ReadFrom(object obj)
        {
            base.ReadFrom(obj);
            if (obj == null)
            {
                return;
            }

            TerrainData o = (TerrainData)obj;

            m_detailResolution         = o.detailResolution;
            m_detailResolutionPerPatch = o.detailResolutionPerPatch;
            m_heightmapResolution      = o.heightmapResolution;
            m_heightMapWidth           = o.heightmapResolution;
            m_heightMapHeight          = o.heightmapResolution;

            m_size = o.size;

            detailPrototypes = Assign(o.detailPrototypes, v_ => (PersistentDetailPrototype <TID>)v_);
            treeInstances    = Assign(o.treeInstances, v_ => (PersistentTreeInstance <TID>)v_);
            treePrototypes   = Assign(o.treePrototypes, v_ => (PersistentTreePrototype <TID>)v_);

            float[,] data = o.GetHeights(0, 0, m_heightMapWidth, m_heightMapHeight);
            m_data        = new float[data.GetLength(0) * data.GetLength(1)];
            Buffer.BlockCopy(data, 0, m_data, 0, m_data.Length * sizeof(float));

            m_alphamapWidth       = o.alphamapWidth;
            m_alphamapHeight      = o.alphamapHeight;
            m_terrainLayersLength = o.terrainLayers.Length;

            float[,,] alphamaps = o.GetAlphamaps(0, 0, m_alphamapWidth, m_alphamapHeight);
            m_alphamaps         = new float[alphamaps.GetLength(0) * alphamaps.GetLength(1) * alphamaps.GetLength(2)];
            Buffer.BlockCopy(alphamaps, 0, m_alphamaps, 0, m_alphamaps.Length * sizeof(float));
        }
示例#2
0
 protected override void ReadFromImpl(object obj)
 {
     base.ReadFromImpl(obj);
     Bounds uo = (Bounds)obj;
     center = uo.center;
     extents = uo.extents;
 }
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            Rigidbody uo = (Rigidbody)obj;

            velocity                 = uo.velocity;
            angularVelocity          = uo.angularVelocity;
            drag                     = uo.drag;
            angularDrag              = uo.angularDrag;
            mass                     = uo.mass;
            useGravity               = uo.useGravity;
            maxDepenetrationVelocity = uo.maxDepenetrationVelocity;
            isKinematic              = uo.isKinematic;
            freezeRotation           = uo.freezeRotation;
            constraints              = uo.constraints;
            collisionDetectionMode   = uo.collisionDetectionMode;
            centerOfMass             = uo.centerOfMass;
            detectCollisions         = uo.detectCollisions;
            position                 = uo.position;
            rotation                 = uo.rotation;
            interpolation            = uo.interpolation;
            solverIterations         = uo.solverIterations;
            sleepThreshold           = uo.sleepThreshold;
            maxAngularVelocity       = uo.maxAngularVelocity;
            solverVelocityIterations = uo.solverVelocityIterations;
        }
示例#4
0
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            Terrain uo = (Terrain)obj;

            terrainData                  = ToID(uo.terrainData);
            treeDistance                 = uo.treeDistance;
            treeBillboardDistance        = uo.treeBillboardDistance;
            treeCrossFadeLength          = uo.treeCrossFadeLength;
            treeMaximumFullLODCount      = uo.treeMaximumFullLODCount;
            detailObjectDistance         = uo.detailObjectDistance;
            detailObjectDensity          = uo.detailObjectDensity;
            heightmapPixelError          = uo.heightmapPixelError;
            heightmapMaximumLOD          = uo.heightmapMaximumLOD;
            basemapDistance              = uo.basemapDistance;
            lightmapIndex                = uo.lightmapIndex;
            realtimeLightmapIndex        = uo.realtimeLightmapIndex;
            lightmapScaleOffset          = uo.lightmapScaleOffset;
            realtimeLightmapScaleOffset  = uo.realtimeLightmapScaleOffset;
            freeUnusedRenderingResources = uo.freeUnusedRenderingResources;
            reflectionProbeUsage         = uo.reflectionProbeUsage;
            materialTemplate             = ToID(uo.materialTemplate);
            drawHeightmap                = uo.drawHeightmap;
            drawTreesAndFoliage          = uo.drawTreesAndFoliage;
            patchBoundsMultiplier        = uo.patchBoundsMultiplier;
            treeLODBiasMultiplier        = uo.treeLODBiasMultiplier;
            collectDetailPatches         = uo.collectDetailPatches;
            editorRenderFlags            = uo.editorRenderFlags;
            preserveTreePrototypeLayers  = uo.preserveTreePrototypeLayers;
            allowAutoConnect             = uo.allowAutoConnect;
            groupingID        = uo.groupingID;
            drawInstanced     = uo.drawInstanced;
            shadowCastingMode = uo.shadowCastingMode;
        }
示例#5
0
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            BoxCollider uo = (BoxCollider)obj;

            center = uo.center;
            size   = uo.size;
        }
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            SphereCollider uo = (SphereCollider)obj;

            center = uo.center;
            radius = uo.radius;
        }
示例#7
0
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            CapsuleCollider uo = (CapsuleCollider)obj;

            center    = uo.center;
            radius    = uo.radius;
            height    = uo.height;
            direction = uo.direction;
        }
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            SkeletonBone uo = (SkeletonBone)obj;

            name     = uo.name;
            position = uo.position;
            rotation = uo.rotation;
            scale    = uo.scale;
        }
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            HumanLimit uo = (HumanLimit)obj;

            useDefaultValues = uo.useDefaultValues;
            min        = uo.min;
            max        = uo.max;
            center     = uo.center;
            axisLength = uo.axisLength;
        }
示例#10
0
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            TreeInstance uo = (TreeInstance)obj;

            position       = uo.position;
            widthScale     = uo.widthScale;
            heightScale    = uo.heightScale;
            rotation       = uo.rotation;
            color          = uo.color;
            lightmapColor  = uo.lightmapColor;
            prototypeIndex = uo.prototypeIndex;
        }
示例#11
0
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            RectTransform uo = (RectTransform)obj;

            anchorMin          = uo.anchorMin;
            anchorMax          = uo.anchorMax;
            anchoredPosition   = uo.anchoredPosition;
            sizeDelta          = uo.sizeDelta;
            pivot              = uo.pivot;
            anchoredPosition3D = uo.anchoredPosition3D;
            offsetMin          = uo.offsetMin;
            offsetMax          = uo.offsetMax;
        }
 protected override void ReadFromImpl(object obj)
 {
     base.ReadFromImpl(obj);
     ParticleSystem.ShapeModule uo = (ParticleSystem.ShapeModule)obj;
     enabled                  = uo.enabled;
     shapeType                = uo.shapeType;
     randomDirectionAmount    = uo.randomDirectionAmount;
     sphericalDirectionAmount = uo.sphericalDirectionAmount;
     randomPositionAmount     = uo.randomPositionAmount;
     alignToDirection         = uo.alignToDirection;
     radius                = uo.radius;
     radiusMode            = uo.radiusMode;
     radiusSpread          = uo.radiusSpread;
     radiusSpeed           = uo.radiusSpeed;
     radiusSpeedMultiplier = uo.radiusSpeedMultiplier;
     radiusThickness       = uo.radiusThickness;
     angle                = uo.angle;
     length               = uo.length;
     boxThickness         = uo.boxThickness;
     meshShapeType        = uo.meshShapeType;
     mesh                 = ToID(uo.mesh);
     meshRenderer         = ToID(uo.meshRenderer);
     skinnedMeshRenderer  = ToID(uo.skinnedMeshRenderer);
     sprite               = ToID(uo.sprite);
     spriteRenderer       = ToID(uo.spriteRenderer);
     useMeshMaterialIndex = uo.useMeshMaterialIndex;
     meshMaterialIndex    = uo.meshMaterialIndex;
     useMeshColors        = uo.useMeshColors;
     normalOffset         = uo.normalOffset;
     arc                          = uo.arc;
     arcMode                      = uo.arcMode;
     arcSpread                    = uo.arcSpread;
     arcSpeed                     = uo.arcSpeed;
     arcSpeedMultiplier           = uo.arcSpeedMultiplier;
     donutRadius                  = uo.donutRadius;
     position                     = uo.position;
     rotation                     = uo.rotation;
     scale                        = uo.scale;
     texture                      = ToID(uo.texture);
     textureClipChannel           = uo.textureClipChannel;
     textureClipThreshold         = uo.textureClipThreshold;
     textureColorAffectsParticles = uo.textureColorAffectsParticles;
     textureAlphaAffectsParticles = uo.textureAlphaAffectsParticles;
     textureBilinearFiltering     = uo.textureBilinearFiltering;
     textureUVChannel             = uo.textureUVChannel;
     meshSpawnMode                = uo.meshSpawnMode;
     meshSpawnSpread              = uo.meshSpawnSpread;
     meshSpawnSpeed               = uo.meshSpawnSpeed;
     meshSpawnSpeedMultiplier     = uo.meshSpawnSpeedMultiplier;
 }
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            Camera uo = (Camera)obj;

            nearClipPlane          = uo.nearClipPlane;
            farClipPlane           = uo.farClipPlane;
            fieldOfView            = uo.fieldOfView;
            renderingPath          = uo.renderingPath;
            allowHDR               = uo.allowHDR;
            allowMSAA              = uo.allowMSAA;
            allowDynamicResolution = uo.allowDynamicResolution;
            forceIntoRenderTexture = uo.forceIntoRenderTexture;
            orthographicSize       = uo.orthographicSize;
            orthographic           = uo.orthographic;
            opaqueSortMode         = uo.opaqueSortMode;
            transparencySortMode   = uo.transparencySortMode;
            transparencySortAxis   = uo.transparencySortAxis;
            depth                         = uo.depth;
            aspect                        = uo.aspect;
            cullingMask                   = uo.cullingMask;
            eventMask                     = uo.eventMask;
            layerCullSpherical            = uo.layerCullSpherical;
            cameraType                    = uo.cameraType;
            layerCullDistances            = uo.layerCullDistances;
            useOcclusionCulling           = uo.useOcclusionCulling;
            cullingMatrix                 = uo.cullingMatrix;
            backgroundColor               = uo.backgroundColor;
            clearFlags                    = uo.clearFlags;
            depthTextureMode              = uo.depthTextureMode;
            clearStencilAfterLightingPass = uo.clearStencilAfterLightingPass;
            usePhysicalProperties         = uo.usePhysicalProperties;
            sensorSize                    = uo.sensorSize;
            lensShift                     = uo.lensShift;
            focalLength                   = uo.focalLength;
            rect                        = uo.rect;
            pixelRect                   = uo.pixelRect;
            targetTexture               = ToID(uo.targetTexture);
            targetDisplay               = uo.targetDisplay;
            worldToCameraMatrix         = uo.worldToCameraMatrix;
            projectionMatrix            = uo.projectionMatrix;
            nonJitteredProjectionMatrix = uo.nonJitteredProjectionMatrix;
            useJitteredProjectionMatrixForTransparentRendering = uo.useJitteredProjectionMatrixForTransparentRendering;
            scene             = uo.scene;
            stereoSeparation  = uo.stereoSeparation;
            stereoConvergence = uo.stereoConvergence;
            stereoTargetEye   = uo.stereoTargetEye;
        }
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            Animator uo = (Animator)obj;

            rootPosition                         = uo.rootPosition;
            rootRotation                         = uo.rootRotation;
            applyRootMotion                      = uo.applyRootMotion;
            updateMode                           = uo.updateMode;
            stabilizeFeet                        = uo.stabilizeFeet;
            feetPivotActive                      = uo.feetPivotActive;
            speed                                = uo.speed;
            cullingMode                          = uo.cullingMode;
            recorderStartTime                    = uo.recorderStartTime;
            recorderStopTime                     = uo.recorderStopTime;
            runtimeAnimatorController            = ToID(uo.runtimeAnimatorController);
            layersAffectMassCenter               = uo.layersAffectMassCenter;
            logWarnings                          = uo.logWarnings;
            fireEvents                           = uo.fireEvents;
            keepAnimatorControllerStateOnDisable = uo.keepAnimatorControllerStateOnDisable;
        }
示例#15
0
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            ParticleSystemRenderer uo = (ParticleSystemRenderer)obj;

            mesh                = ToID(uo.mesh);
            alignment           = uo.alignment;
            renderMode          = uo.renderMode;
            sortMode            = uo.sortMode;
            lengthScale         = uo.lengthScale;
            velocityScale       = uo.velocityScale;
            cameraVelocityScale = uo.cameraVelocityScale;
            normalDirection     = uo.normalDirection;
            sortingFudge        = uo.sortingFudge;
            minParticleSize     = uo.minParticleSize;
            maxParticleSize     = uo.maxParticleSize;
            pivot               = uo.pivot;
            maskInteraction     = uo.maskInteraction;
            trailMaterial       = ToID(uo.trailMaterial);
            enableGPUInstancing = uo.enableGPUInstancing;
            shadowBias          = uo.shadowBias;
            flip                = uo.flip;
            allowRoll           = uo.allowRoll;
        }