/// <summary> /// 增加一个销毁脚本 /// /// 开启一个销毁 /// </summary> /// <returns></returns> public static LCSelfDestroy Begin(GameObject go, float dtyTime) { LCSelfDestroy dest = LCSCompHelper.FindComponet <LCSelfDestroy>(go); dest.mDtyTime = dtyTime; return(dest); }
protected override void OnMouseLeftDown() { UnityEngine.Debug.Log(Input.mousePosition); if (mTempEff == null) { return; } GameObject go = NGUITools.AddChild(gameObject, mTempEff); if (go == null) { return; } LCSelfDestroy dty = go.AddComponent <LCSelfDestroy>(); dty.mDtyTime = 1f; dty.transform.localScale = Vector3.one * 0.5f; dty.transform.localRotation = Quaternion.Euler(new Vector3(-90f, 0, 0)); Vector3 pos2 = UICamera.currentCamera.ScreenToWorldPoint(Input.mousePosition); dty.transform.position = pos2; }
/// <summary> /// 清理特效 /// </summary> public void ClearEffect() { mHeroObj.RemoveEffect(this); mHeroObj = null; mTargetObj = null; mOffset = Vector3.zero; mTweenPos = null; mSkillEntity = null; mDestroy = null; GameObject.DestroyObject(gameObject); }