TestCastSkill.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. //using UnityEngine;
  2. //using System.Collections;
  3. //using System.Collections.Generic;
  4. ///// <summary>
  5. /////
  6. ///// </summary>
  7. //public class TestCastSkill : MonoBehaviour
  8. //{
  9. // public Transform m_EffectParent = null;
  10. // public Transform m_Target = null;
  11. // public Transform m_Start = null;
  12. // /// <summary>
  13. // ///
  14. // /// </summary>
  15. // private GameObject mBtnCastSkill = null;
  16. // public GameObject m_ReadyEffect = null;
  17. // public GameObject m_ShootEffect = null;
  18. // public GameObject m_SendEffect = null;
  19. // public GameObject m_BombEffect = null;
  20. // /// <summary>
  21. // /// 投射层.
  22. // /// </summary>
  23. // public LayerMask layerMask;
  24. // /// <summary>
  25. // ///
  26. // /// </summary>
  27. // void Start()
  28. // {
  29. // CameraManager.Instance.Init();
  30. // this.mBtnCastSkill = this.transform.Find("BtnCastSkill").gameObject;
  31. // EventTriggerListener.Get(mBtnCastSkill).onClick = OnBtnCastSkill;
  32. // layerMask.value = 1 << 11;
  33. // }
  34. // /// <summary>
  35. // /// 初始化各个效果需要的数据
  36. // /// </summary>
  37. // void InitEffectData()
  38. // {
  39. // }
  40. // /// <summary>
  41. // /// 释放技能
  42. // /// </summary>
  43. // /// <param name="obj"></param>
  44. // public void OnBtnCastSkill(GameObject obj)
  45. // {
  46. // LogHelper.Log("enter");
  47. // GameObject temp = (GameObject)Instantiate(this.m_SendEffect);
  48. // temp.transform.SetParent(m_EffectParent);
  49. // ProjectileArcGUI proj = temp.AddComponent<ProjectileArcGUI>();
  50. // temp.SetActive(false);
  51. // Transform[] all = temp.GetComponentsInChildren<Transform>();
  52. // foreach (Transform rc in all)
  53. // {
  54. // rc.gameObject.layer = LayerMask.NameToLayer("BattleScreen"); //指定Layer
  55. // }
  56. // temp.SetActive(true);
  57. // proj.init(m_Start.position, m_Target.position, m_Target, layerMask, 1.0f, 10.0f, 0);
  58. // }
  59. // /// <summary>
  60. // /// 处理一下~
  61. // /// </summary>
  62. // /// <param name="model"></param>
  63. // /// <param name="trgPos"></param>
  64. // public void BattleEffectHandle(Transform model, Vector3 trgPos)
  65. // {
  66. // Transform[] all = model.GetComponentsInChildren<Transform>();
  67. // foreach (Transform rc in all)
  68. // {
  69. // rc.gameObject.layer = LayerMask.NameToLayer("BattleScreen"); //指定Layer
  70. // }
  71. // Vector3 trgUIPos = Vector3.zero;
  72. // Vector3 screenPosStart = CameraManager.Instance.Battle3D.WorldToViewportPoint(trgPos);
  73. // Vector3 pos = CameraManager.Instance.BattleScreenEffect.ViewportToWorldPoint(screenPosStart);
  74. // trgUIPos = new Vector2(pos.x, pos.y);
  75. // model.transform.SetParent(transform);
  76. // model.transform.position = trgUIPos;
  77. // model.transform.rotation = Quaternion.identity;
  78. // model.transform.localScale = new Vector3(1, 1, 1);
  79. // }
  80. // /// <summary>
  81. // ///
  82. // /// </summary>
  83. // void Update()
  84. // {
  85. // }
  86. //}