Transform SetEffect(StageClickType type, int ID) { string path = ""; if (type == StageClickType.Room) { path = "Textures/room/"; } else if (type == StageClickType.Role || type == StageClickType.Captain) { path = "Textures/role/"; } else if (type == StageClickType.Item) { path = "Textures/item/"; } GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "DropReward", m_target.transform.position + m_EndPos, BattleEnvironmentM.GetLifeMBornNode(true)); if (gae != null) { gae.transform.localScale = m_StartScale; Sprite s = GameObjectLoader.LoadSprite(path, ID.ToString()); if (s != null) { foreach (SpriteRenderer r in gae.gameObject.GetComponentsInChildren <SpriteRenderer>()) { r.sprite = s; } } GameObjectActionWait gaw = new GameObjectActionWait(1.0f); gae.AddAction(gaw); GameObjectActionResourceFlyToUI gar = new GameObjectActionResourceFlyToUI(); gar.SetData(EffectCamera.camera, WndManager.GetNGUICamera(), 1, ResourceType.Box); gae.AddAction(gar); return(gae.transform); } return(null); }