Exemple #1
0
        protected override void OnCopyTo(Resource r, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(r, provider);
            DrawTechnique c = r as DrawTechnique;

            c.blendType = this.blendType;
        }
Exemple #2
0
        protected override void OnCopyTo(Component target, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(target, provider);
            SoundEmitter c = target as SoundEmitter;

            c.sources = this.sources == null ? null : this.sources.Select(s => provider.RequestObjectClone(s)).ToList();
        }
Exemple #3
0
        protected override void OnCopyTo(Component target, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(target, provider);
            Transform t = target as Transform;

            t.deriveAngle  = this.deriveAngle;
            t.ignoreParent = this.ignoreParent;

            t.pos   = this.pos;
            t.angle = this.angle;
            t.scale = this.scale;

            t.posAbs   = this.posAbs;
            t.angleAbs = this.angleAbs;
            t.scaleAbs = this.scaleAbs;

            t.tempVel         = this.tempVel;
            t.tempVelAbs      = this.tempVelAbs;
            t.tempAngleVel    = this.tempAngleVel;
            t.tempAngleVelAbs = this.tempAngleVelAbs;

            t.velAbs      = this.velAbs;
            t.vel         = this.vel;
            t.angleVel    = this.angleVel;
            t.angleVelAbs = this.angleVelAbs;

            // Update absolute transformation.
            // Need to update parent transform, because this may happen
            // during Prefab.Apply, which occurs before OnLoaded.
            t.parentTransform = (t.gameobj != null && t.gameobj.Parent != null) ? t.gameobj.Parent.Transform : null;
            t.UpdateAbs();
        }
Exemple #4
0
        protected override void OnCopyTo(Resource r, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(r, provider);
            AudioData c = r as AudioData;

            c.data = (byte[])this.data.Clone();
        }
Exemple #5
0
        protected override void OnCopyTo(Component target, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(target, provider);
            Transform t = target as Transform;

            t.deriveAngle  = this.deriveAngle;
            t.ignoreParent = this.ignoreParent;

            t.pos   = this.pos;
            t.angle = this.angle;
            t.scale = this.scale;

            t.posAbs   = this.posAbs;
            t.angleAbs = this.angleAbs;
            t.scaleAbs = this.scaleAbs;

            t.tempVel         = this.tempVel;
            t.tempVelAbs      = this.tempVelAbs;
            t.tempAngleVel    = this.tempAngleVel;
            t.tempAngleVelAbs = this.tempAngleVelAbs;

            t.velAbs      = this.velAbs;
            t.vel         = this.vel;
            t.angleVel    = this.angleVel;
            t.angleVelAbs = this.angleVelAbs;

            t.UpdateAbs();
        }
Exemple #6
0
        protected override void OnCopyTo(Component target, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(target, provider);
            Renderer t = target as Renderer;

            t.visibilityGroup = this.visibilityGroup;
        }
Exemple #7
0
        protected override void OnCopyTo(Resource r, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(r, provider);
            Scene s = r as Scene;

            // Apply general properties
            s.globalGravity = this.globalGravity;

            // Copy objects
            s.objectManager.Clear();
            foreach (GameObject obj in this.RootObjects)
            {
                if (provider.GetRegisteredObjectClone(obj) != null)
                {
                    continue;
                }

                GameObject clone = new GameObject();
                provider.RegisterObjectClone(obj, clone);
                obj.PrepassCopyData(clone, provider);
            }
            foreach (GameObject obj in this.RootObjects)
            {
                GameObject clone = provider.GetRegisteredObjectClone(obj);
                provider.CopyObjectTo(obj, clone);
                s.objectManager.AddObject(clone);
            }
        }
Exemple #8
0
        protected override void OnCopyTo(Resource r, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(r, provider);
            Material c = r as Material;

            c.info = new BatchInfo(this.info);
            c.info.CleanDirty();
        }
Exemple #9
0
        protected override void OnCopyTo(Resource r, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(r, provider);
            RenderTarget c = r as RenderTarget;

            c.multisampling = this.multisampling;
            c.targetInfo    = new List <TargetInfo>(this.targetInfo);
            c.SetupOpenGLRes();
        }
Exemple #10
0
        protected override void OnCopyTo(Component target, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(target, provider);
            Camera t = target as Camera;

            t.nearZ          = this.nearZ;
            t.farZ           = this.farZ;
            t.focusDist      = this.focusDist;
            t.visibilityMask = this.visibilityMask;
            t.passes         = this.passes != null ? new List <Pass>(this.passes.Select(p => new Pass(p))) : null;
        }
Exemple #11
0
        protected override void OnCopyTo(Resource r, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(r, provider);
            ShaderProgram c = r as ShaderProgram;

            c.AttachShaders(this.vert, this.frag);
            if (this.compiled)
            {
                c.Compile();
            }
        }
Exemple #12
0
        protected override void OnCopyTo(Component target, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(target, provider);
            LayerRenderer t = target as LayerRenderer;

            t.sharedMat = this.sharedMat;
            t.rect      = this.rect;
            t.colorTint = this.colorTint;
            t.rectMode  = this.rectMode;
            t.offset    = this.offset;
        }
Exemple #13
0
        protected override void OnCopyTo(Component target, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(target, provider);
            TextRenderer t = target as TextRenderer;

            t.blockAlign = this.blockAlign;
            t.text       = this.text.Clone();
            t.colorTint  = this.colorTint;
            t.customMat  = this.customMat != null ? new BatchInfo(this.customMat) : null;
            t.iconMat    = this.iconMat;
        }
Exemple #14
0
        protected override void OnCopyTo(Resource r, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(r, provider);
            AbstractShader c = r as AbstractShader;

            c.source     = this.source;
            c.sourcePath = null;
            if (this.compiled)
            {
                c.Compile();
            }
        }
Exemple #15
0
        protected override void OnCopyTo(Component target, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(target, provider);
            AnimSpriteRenderer t = target as AnimSpriteRenderer;

            t.animDuration        = this.animDuration;
            t.animFirstFrame      = this.animFirstFrame;
            t.animFrameCount      = this.animFrameCount;
            t.animLoopMode        = this.animLoopMode;
            t.animTime            = this.animTime;
            t.customFrameSequence = this.customFrameSequence != null?this.customFrameSequence.ToList() : null;
        }
Exemple #16
0
        protected override void OnCopyTo(Resource r, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(r, provider);
            Scene s = r as Scene;

            // Apply general properties
            s.globalGravity = this.globalGravity;

            // Copy objects
            s.objectManager.Clear();
            s.objectManager.AddObject(this.RootObjects.Select(o => provider.RequestObjectClone(o)));
        }
Exemple #17
0
        protected override void OnCopyTo(Component target, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(target, provider);
            SpriteRenderer t = target as SpriteRenderer;

            t.sharedMat = this.sharedMat;
            t.customMat = this.customMat != null ? new BatchInfo(this.customMat) : null;
            t.rect      = this.rect;
            t.colorTint = this.colorTint;
            t.rectMode  = this.rectMode;
            t.offset    = this.offset;
        }
Exemple #18
0
        protected override void OnCopyTo(Resource r, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(r, provider);
            Texture c = r as Texture;

            c.size        = this.size;
            c.filterMag   = this.filterMag;
            c.filterMin   = this.filterMin;
            c.wrapX       = this.wrapX;
            c.wrapY       = this.wrapY;
            c.pixelformat = this.pixelformat;
            c.LoadData(this.basePixmap, this.texSizeMode);
        }
Exemple #19
0
        protected override void OnCopyTo(Resource r, Duality.Cloning.CloneProvider provider)
        {
            base.OnCopyTo(r, provider);
            Sound c = r as Sound;

            c.maxInstances  = this.maxInstances;
            c.minDistFactor = this.minDistFactor;
            c.maxDistFactor = this.maxDistFactor;
            c.volFactor     = this.volFactor;
            c.pitchFactor   = this.pitchFactor;
            c.fadeOutAt     = this.fadeOutAt;
            c.fadeOutTime   = this.fadeOutTime;
            c.LoadData(this.audioData);
        }
Exemple #20
0
 protected override void OnCopyTo(Component target, Duality.Cloning.CloneProvider provider)
 {
     base.OnCopyTo(target, provider);
     SoundListener c = target as SoundListener;
 }