Esempio n. 1
0
    override protected void LineToOther(HNode other)
    {
        GameObject selfRoot  = GetNodeRoot();
        GameObject otherRoot = other.GetNodeRoot();

        if (selfRoot == otherRoot)
        {
            return;
        }

        HNodeReceive otherNodeTemp = other as HNodeReceive;

        if (otherNodeTemp == null)
        {
            return;
        }

        m_targetNode = other;
        if (m_line != null)
        {
            Destroy(m_line.gameObject);
            m_line = null;
        }
        m_line = DrawLineToOther(other);
    }
Esempio n. 2
0
 private void OnDisable()
 {
     if (m_targetNode != null)
     {
         m_targetNode = null;
         Destroy(m_line);
         m_line = null;
     }
 }
Esempio n. 3
0
    virtual protected HLineLinked DrawLineToOther(HNode other)
    {
        GameObject gObj = Resources.Load("Prefabs/LineLinked") as GameObject;

        gObj = Instantiate(gObj, G.HNV_lineParent.transform);
        HLineLinked line = gObj.GetComponent <HLineLinked>();

        line.SetPosition(1, transform.position);
        line.SetPosition(2, other.transform.position);
        line.SetLinkedTarget(this, other);
        return(line);
    }
Esempio n. 4
0
    override public void ClearLink(HNode other)
    {
        if (m_targetNode != other)
        {
            G.Error("target != other");
            return;
        }

        m_targetNode = null;
        if (m_line != null)
        {
            m_line = null;
        }
    }