Inheritance: MonoBehaviour
Example #1
0
 // Use this for initialization
 void Awake()
 {
     this.textMesh       = this.GetComponentInChildren <TextMesh>();
     this.textSize       = new TextSize(textMesh);
     this.flyInAnimation = this.GetComponent <FlyIn>();
     this.startColor     = this.renderer ? this.renderer.material.color : Color.white;
 }
Example #2
0
        public int CompareTo(BLeaderStartingSquad other)
        {
            if (FlyIn != other.FlyIn)
            {
                FlyIn.CompareTo(other.FlyIn);
            }

            if (Offset != other.Offset)
            {
                Offset.CompareTo(other.Offset);
            }

            return(SquadID.CompareTo(other.SquadID));
        }
Example #3
0
 public void SetAnimationsRecursive(bool visibility, GameObject startObj)
 {
     Helpers.TraverseChildren(delegate(GameObject obj) {
         FlyIn animation = obj.GetComponent <FlyIn>();
         if (animation != null)
         {
             if (visibility)
             {
                 animation.TriggerIn();
             }
             else
             {
                 animation.TriggerOut();
             }
         }
     }, startObj);
 }
Example #4
0
		void DoFlyIn(ITPhaseControl control, int steps)
		{
			// Create a pixmap to represent the control to be animated
            GDIDIBSection srcPixelBuffer = new GDIDIBSection((int)(control.Frame.Width), (int)(control.Frame.Height));
            IGraphPort srcGraphics = srcPixelBuffer.GraphPort;
            srcPixelBuffer.DeviceContext.ClearToWhite();

            // Draw the control into its bitmap
            DrawEvent sde = new DrawEvent(srcGraphics, Frame);
            control.OnDraw(sde);
            srcGraphics.Flush();
            
            // Get the current image of what's being displayed
            GDIDIBSection dstPixelBuffer = this.BackingImage;
            IGraphPort dstGraphics = dstPixelBuffer.GraphPort;
            dstPixelBuffer.DeviceContext.ClearToWhite();

            DrawEvent dde = new DrawEvent(dstGraphics, Frame);
            this.Draw(dde);

			// At this point we have two bitmaps that hold the images of the 
			// background, and the graphic that will fly in.


			// Get a hold of our window's graphics port
            IGraphPort grfx = Window.ClientAreaGraphPort;
            
            // Draw the current destination image into the graphport
            grfx.PixBlt(dstPixelBuffer, 0, 0);


            Rectangle startFrame = new Rectangle(0, (int)(control.Frame.Top), (int)(control.Frame.Width), (int)(control.Frame.Height));
			//Rectangle startFrame = new Rectangle(0, 0, (int)(control.Frame.Width), (int)(control.Frame.Height));
			Rectangle endFrame = new Rectangle((control.Frame.Left), (control.Frame.Top), (control.Frame.Width), (control.Frame.Height));

            FlyIn transition = new FlyIn(startFrame, endFrame, steps);
            transition.SourcePixelBuffer = srcPixelBuffer;
            transition.DestinationPixelBuffer = dstPixelBuffer;

            transition.Run(grfx);
            //FlyAGraphic(grfx, srcPixelBuffer, startFrame, dstPixelBuffer, endFrame, steps);

			// Cleanup
			srcPixelBuffer.Dispose();
		}