示例#1
0
    // Use this for initialization
    void Start()
    {
        handExtra  = hand.gameObject.GetComponent <GrabThings> ();
        tWiggle    = gameObject.GetComponent <TextWiggle> ();
        glyphs     = glyphManager.GetGlyphs();
        throwables = new BoxCollider[throwablesCluster.transform.childCount + glyphs.Length + entranceCluster.transform.childCount];

        text = gameObject.GetComponent <Text> ();
        for (int i = 0; i < throwablesCluster.transform.childCount; i++)
        {
            throwables [i] = throwablesCluster.transform.GetChild(i).GetComponent <BoxCollider> ();
        }
        for (int i = 0; i < glyphs.Length; i++)
        {
            throwables [throwablesCluster.transform.childCount + i] = glyphs [i].GetComponent <BoxCollider> ();
        }
        for (int i = 0; i < entranceCluster.transform.childCount; i++)
        {
            if (entranceCluster.transform.GetChild(i).GetComponent <BoxCollider> () != null)
            {
                throwables [throwablesCluster.transform.childCount + glyphs.Length + i] = entranceCluster.transform.GetChild(i).GetComponent <BoxCollider> ();
            }
        }
        distance = (throwables [0].transform.position - hand.transform.position).sqrMagnitude;
        closest  = 0;
        //StartCoroutine (textWiggle ());
    }
示例#2
0
 // Use this for initialization
 void Start()
 {
     text    = gameObject.GetComponent <Text> ();
     tWiggle = gameObject.GetComponent <TextWiggle> ();
     buttons = new BoxCollider[buttonCluster.transform.childCount];
     for (int i = 0; i < buttonCluster.transform.childCount; i++)
     {
         buttons [i] = buttonCluster.transform.GetChild(i).GetComponent <BoxCollider>();
     }
     distance = (buttons [0].transform.position - hand.transform.position).sqrMagnitude;
     closest  = 0;
 }