// Update is called once per frame void Update () { if(m_target == null ||m_start == null) return; if(m_MeshEffect == null) { m_MeshEffect = gameObject.GetComponent<AsMeshEffect>(); } transform.parent = null; transform.position = m_start.position; transform.rotation = Quaternion.identity; float fDist = Vector3.Distance (m_target.position, transform.position); if(m_MeshEffect.m_Play) SetPlanVertex(fDist); gameObject.transform.LookAt(m_target.position); }
// Use this for initialization void Start () { m_MeshEffect = gameObject.GetComponent<AsMeshEffect>(); }