//デフォルトオブジェクトとして描画する
		internal AdvGraphicObject DrawToDefault(string name, AdvGraphicOperaitonArg arg)
		{
			//デフォルトオブジェクトの名前が違うなら、そのオブジェクトを消す
			if (DefaultObject != null && DefaultObject.name != name)
			{
				//フェードアウトする
				FadeOut(DefaultObject.name, arg.FadeTime);
			}
			defaultObject = GetObjectCreateIfMissing(name,arg);
			defaultObject.Draw(arg);
			return defaultObject;
		}
		/// <summary>
		/// ロードする
		/// </summary>
		public void OnLoadObject(AdvGraphicObject advGraphicObject) { }
		/// <summary>
		/// デフォルト描画
		/// </summary>
		public void OnDrawDefault(AdvGraphicObject advGraphicObject, AdvGraphicOperaitonArg arg) { }
		//カラーを取得
		Color GetColor( AdvEngine engine, AdvGraphicObject obj )
		{
			return ( obj.name == engine.Page.CharacterLabel ) ? MainColor : SubColor;
		}
		/// <summary>
		/// 初期化
		/// </summary>
		/// <param name="type">Tweenのデータ</param>
		/// <param name="hashObjects">Tweenのパラメーター</param>
		/// <param name="loopCount">ループ回数</param>
		/// <param name="pixelsToUnits">座標1.0単位辺りのピクセル数</param>
		/// <param name="skipSpeed">スキップ中の演出速度の倍率。0ならスキップなし</param>
		/// <param name="callbackComplete">終了時に呼ばれるコールバック</param>
		public void Init(iTweenData data, float pixelsToUnits, float skipSpeed, Action<AdvTweenPlayer> callbackComplete)
		{
			this.data = data;
			if (data.Type == iTweenType.Stop) return;

			this.callbackComplete = callbackComplete;

			data.ReInit();
			hashTbl = iTween.Hash(data.HashObjects.ToArray());

			//2D座標にあわせる
			if (iTweenData.IsPostionType(data.Type))
			{
				if (hashTbl.ContainsKey("x")) hashTbl["x"] = (float)hashTbl["x"] / pixelsToUnits;
				if (hashTbl.ContainsKey("y")) hashTbl["y"] = (float)hashTbl["y"] / pixelsToUnits;
				if (hashTbl.ContainsKey("z")) hashTbl["z"] = (float)hashTbl["z"] / pixelsToUnits;
			}
			//スキップ中なら演出時間を調整
			if (skipSpeed > 0)
			{
				bool isSpeed = hashTbl.ContainsKey("speed");
				if (isSpeed) hashTbl["speed"] = (float)hashTbl["speed"] * skipSpeed;

				bool isTime = hashTbl.ContainsKey("time");
				if(isTime)
				{
					hashTbl["time"] = (float)hashTbl["time"]/ skipSpeed;
				}
				else if(!isSpeed)
				{
					hashTbl["time"] = 1.0f / skipSpeed;
				}
			}

			//カラーの処理を2D仕様に
			if (data.Type == iTweenType.ColorTo || data.Type == iTweenType.ColorFrom)
			{
				this.graphicObject = this.gameObject.GetComponent<AdvGraphicObject>();
				if (graphicObject != null)
				{
					Color currentColor = graphicObject.EffectColors.GetColor(EffectColors.Index.TweenColor);
					if (data.Type == iTweenType.ColorTo)
					{
						hashTbl["from"] = currentColor;
						hashTbl["to"] = ParaseTargetColor(hashTbl, currentColor);
					}
					else if (data.Type == iTweenType.ColorFrom)
					{
						hashTbl["from"] = ParaseTargetColor(hashTbl, currentColor);
						hashTbl["to"] = currentColor;
					}
					hashTbl["onupdate"] = "OnColorUpdate";
					isColorSprite = true;
				}
			}

			//終了時に呼ばれるメッセージを登録
			hashTbl["oncomplete"] = "OnComplete";
			hashTbl["oncompletetarget"] = this.gameObject;
			hashTbl["oncompleteparams"] = this;

			//停止処理用に名前を設定
			tweenName = this.GetHashCode().ToString();
			hashTbl["name"] = tweenName;
		}
		//指定の名前のオブジェクトを取得、なければ作成
		internal AdvGraphicObject AddObject(string name, GraphicInfoList grapic, bool isDefault )
		{
			Type type = AdvGraphicObjectFactory.Create(grapic.FileType);
			GameObject go = UtageToolKit.AddChildGameObject(this.transform, name);
			AdvGraphicObject obj = go.AddComponent(type) as AdvGraphicObject;
			obj.Init(this);
			currentGraphics.Add(name, obj);
			if(isDefault) defaultObject = obj;
			return obj;
		}
		//旧バージョン(LayerManagerだったころ)のレイヤーデータ読み込み
		internal void ReadOld(BinaryReader reader)
		{
			//Transofom,Colorを空読み込み
			Vector3 pos = new Vector3();
			Vector3 euler = new Vector3();
			Vector3 scale = new Vector3();
			UtageToolKit.ReadLocalTransform(reader, out pos, out euler, out scale);
			UtageToolKit.ReadColor(reader);

			//Tween情報を空読み込み
			int tweenCount = reader.ReadInt32();
			for (int i = 0; i < tweenCount; ++i)
			{
				AdvTweenPlayer tween = this.gameObject.AddComponent<AdvTweenPlayer>() as AdvTweenPlayer;
				tween.Read(reader, Manager.PixelsToUnits);
				Destroy(tween);
			}

			//各スプライトの読み込み
			int count = reader.ReadInt32();
			for (int i = 0; i < count; ++i)
			{
				string name = reader.ReadString();
				GameObject go = UtageToolKit.AddChildGameObject(this.transform, name);
				AdvGraphicObject2DSprite obj = go.AddComponent<AdvGraphicObject2DSprite>();
				obj.Init(this);
				currentGraphics.Add(name, obj);
				obj.ReadOld(reader);
			}
			//デフォルトオブジェクトを設定
			defaultObject = Find(reader.ReadString());
		}
		//(古いバージョンのデータを読み込むときに使う)
		internal void SetDefault(string defualtSpriteName)
		{
			AdvGraphicObject obj = Find(defualtSpriteName);
			if(obj!=null)
			{
				defaultObject = obj;
			}
		}
		//クリア処理
		internal void Clear()
		{
			foreach (var obj in currentGraphics.Values)
			{
				obj.Clear();
			}
			currentGraphics.Clear();
			defaultObject = null;
		}
		internal void FadeOutAll(float fadeTime)
		{
			foreach (var obj in currentGraphics.Values)
			{
				obj.FadeOut(fadeTime);
			}
			currentGraphics.Clear();
			defaultObject = null;
		}
		//フェードアウト
		internal void FadeOut(string name, float fadeTime)
		{
			AdvGraphicObject obj;
			if (currentGraphics.TryGetValue(name, out obj))
			{
				obj.FadeOut(fadeTime);
				currentGraphics.Remove(name);
				if (defaultObject == obj)
				{
					defaultObject = null;
				}
			}
		}