public override void Start() { base.Start(); GameObject box = U3DUtil.FindChild(m_target, "box"); if (box != null) { box.SetActive(false); } GameObject go = GameObjectLoader.LoadPath("effect/prefab/", "2000601", m_target.transform); if (go != null) { GameObjectLoader.SetGameObjectLayer(go, LayerMask.NameToLayer("Resource")); ParticleSystem s = go.GetComponent <ParticleSystem>(); if (s != null) { s.Play(); } } m_itemTransform = SetEffect(m_itemtype, m_itemID); }
public void GoldCoinEffect(int num, int count) { for (int i = 0; i < num; i++) { Vector3 pos = MapGrid.GetMG(m_Attr.Pos).pos; //+new Vector3(Random.Range(1,m_Attr.Size*0.5f-2),-0.5f,1f); pos += new Vector3(0, 0.25f, 1.2f); pos = BattleEnvironmentM.Local2WorldPos(pos); int n = (int)count / num; if (i == 0) { n += count - num * ((int)count / num); } GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000041", EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true)); //EffectCamera.AddFollowList(gae.transform,pos); if (gae != null) { GameObjectActionResourceDrop gaw = new GameObjectActionResourceDrop(2f, pos, pos + new Vector3(Random.Range(-1.5f, 1.5f), 0, 0)); gae.AddAction(gaw); GameObjectActionResourceFlyToUI gar = new GameObjectActionResourceFlyToUI(); gar.SetData(EffectCamera.camera, WndManager.GetNGUICamera(), n, ResourceType.Gold); gae.AddAction(gar); GameObject coin = U3DUtil.FindChild(gae.gameObject, "coin"); if (coin != null) { coin.GetComponent <ParticleSystem>().startDelay = Random.Range(1f, 1.5f); } } } }
public override void Start() { base.Start(); GameObject box = U3DUtil.FindChild(m_target, "box"); if (box != null) { box.SetActive(true); } GameObject Item = U3DUtil.FindChild(m_target, "Item"); if (Item != null) { Item.SetActive(false); } }