Beispiel #1
0
        public static void CallDecoratorPattern()
        {
            IceCream iceCreamChocolate = new Chocolate();

            iceCreamChocolate = new Sprinkle(iceCreamChocolate);
            iceCreamChocolate = new Fudge(iceCreamChocolate);

            Console.WriteLine("Chocolate Ice Cream with Sprinkles, Fudge = " + iceCreamChocolate.Cost().ToString("C"));

            IceCream iceCreamVanilla = new Vanilla();

            iceCreamVanilla = new Sprinkle(iceCreamVanilla);
            iceCreamVanilla = new Fudge(iceCreamVanilla);
            iceCreamVanilla = new Caramel(iceCreamVanilla);
            iceCreamVanilla = new WhipCream(iceCreamVanilla);
            iceCreamVanilla = new WaffleCone(iceCreamVanilla);

            Console.WriteLine("Vanilla Ice Cream with Sprinkles, Fudge, Caramel, WhipCream, WaffleCone = " + iceCreamVanilla.Cost().ToString("C"));

            Console.ReadKey();
        }
Beispiel #2
0
	void Start () {
		paddleScript = GameObject.FindObjectOfType<Paddle>();
		waffleCone = GameObject.FindObjectOfType<WaffleCone>();
		
	}
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     ballPosition  = GameObject.FindObjectOfType <Ball>();
     messageKitKat = GameObject.FindObjectOfType <KitKatPaddle>();
     messageWaffle = GameObject.FindObjectOfType <WaffleCone>();
 }