//using UnityEngine; //using System.Collections; ///// ///// ///// //public class TestScreenMove : MonoBehaviour //{ // /// // /// // /// // public Transform startObj = null; // /// // /// // /// // public Transform endObj = null; // /// // /// // /// // public GameObject projectileEff=null; // /// // /// // /// // private Vector3 startPos, endPos; // /// // /// // /// // public bool IsMove = false; // /// // /// // /// // void Start() // { // CameraManager.Instance.Init(); // } // /// // /// // /// // void OnGUI() // { // if( GUI.Button(new Rect(100,100,100,50),"CastSkill")) // { // this.CreatePrebBullet(startPos, endPos); // } // } // /// // /// // /// // void RefreshPos() // { // Vector3 screenPosStart = CameraManager.Instance.Battle3D.WorldToViewportPoint(this.startObj.transform.position); // Vector3 _startPos = CameraManager.Instance.BattleScreenEffect.ViewportToWorldPoint(screenPosStart); // Vector3 screenPosEnd = CameraManager.Instance.Battle3D.WorldToViewportPoint(this.endObj.transform.position); // Vector3 _endPos = CameraManager.Instance.BattleScreenEffect.ViewportToWorldPoint(screenPosEnd); // startPos = new Vector2(_startPos.x, _startPos.y); // endPos = new Vector2(_endPos.x, _endPos.y); // } // /// // /// 创建外部预置物体类型子弹 // /// // /// // /// 发射点 // void CreatePrebBullet(Vector3 startPos, Vector3 endPos) // { // this.RefreshPos(); // GameObject temp = (GameObject)Instantiate(this.projectileEff); // this.ResetLayer(temp.transform); // this.BattleEffectHandle(temp.transform, endObj.transform.position); // if (IsMove) // { // Test2DMove Projectile = temp.AddComponent() as Test2DMove; // Projectile.Init(startPos, endPos); // } // else // { // Destroy(temp, 1.5f); // } // } // /// // /// // /// // /// // public void ResetLayer(Transform model) // { // Transform[] all = model.GetComponentsInChildren(); // foreach (Transform rc in all) // { // rc.gameObject.layer = LayerMask.NameToLayer("BattleScreen"); //指定Layer // } // } // /// // /// 处理一下~ // /// // /// // /// // public void BattleEffectHandle(Transform model, Vector3 trgPos) // { // Vector3 trgUIPos = Vector3.zero; // Vector3 screenPosStart = CameraManager.Instance.Battle3D.WorldToViewportPoint(trgPos); // Vector3 pos = CameraManager.Instance.BattleScreenEffect.ViewportToWorldPoint(screenPosStart); // trgUIPos = new Vector2(pos.x, pos.y); // model.transform.SetParent(transform); // model.transform.position = trgUIPos; // model.transform.rotation = Quaternion.identity; // model.transform.localScale = new Vector3(1, 1, 1); // } //}