示例#1
0
    public void SetArrow(GameObject arrowObj)
    {
        InitWidgets();
        if (m_MainMissionArrow == null)
        {
            Transform arrowParent   = arrowObj.transform.parent;
            Vector3   posArrowLocal = arrowParent.InverseTransformPoint(arrowObj.transform.position);
            Vector3   transLocal    = arrowParent.InverseTransformPoint(transform.position);
            Vector3   target        = Vector3.zero;
            target.x = transLocal.x + m_widght.width + arrowObj.GetComponent <UISprite>().width * 0.5f + 5;
            target.y = transLocal.y - m_widght.height * 0.5f;
            arrowObj.transform.position = arrowParent.TransformPoint(target);

            //TweenPosition tp = arrowObj.GetComponent<TweenPosition>();
            //tp.from = arrowObj.transform.localPosition;
            //Vector3 pos = arrowObj.transform.localPosition;
            //pos.x += 20;
            //tp.to = pos;
            //tp.duration = 0.5f;
            //tp.style = UITweener.Style.PingPong;

            int width  = this.gameObject.GetComponent <UIWidget>().width;
            int height = this.gameObject.GetComponent <UIWidget>().height + 16;
            arrowObj.transform.position = new Vector3(this.transform.position.x + 0.5f * width, this.transform.position.y - 0.5f * height + 9, this.transform.position.z);
            arrowObj.GetComponent <UIWidget>().width  = width + 15;
            arrowObj.GetComponent <UIWidget>().height = height;

            m_MainMissionArrow = new MainMissionArrow();
            m_MainMissionArrow.Init(arrowObj);
        }
    }
示例#2
0
 public void Clear()
 {
     m_taskInfo    = null;
     m_bShow       = false;
     m_nPreOpreate = 0;
     m_nPreState   = 0;
     m_nHeight     = 0;
     transform.gameObject.SetActive(false);
     if (m_MainMissionArrow != null)
     {
         m_MainMissionArrow.Clear();
         m_MainMissionArrow = null;
     }
 }