예제 #1
0
        public object Clone()
        {
            ConcretePrototype pNewObj = new ConcretePrototype();

            pNewObj.Name = this.Name;
            return(pNewObj);
        }
예제 #2
0
	void UnitTest () {

		// 原始物件
		ConcretePrototype Obj =new ConcretePrototype();
		Obj.Name = "ConcreteObj1";

		// 複製物件
		ConcretePrototype CloneObj = Obj.Clone() as ConcretePrototype;

		// 顯示
		Debug.Log("原始物件:"+Obj.Name);
		Debug.Log("複製物件:"+CloneObj.Name);

	
	}
예제 #3
0
		public object Clone()
		{
			ConcretePrototype pNewObj = new ConcretePrototype();
			pNewObj.Name = this.Name;
			return pNewObj;
		}