Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     enter       = false;
     plus        = true;
     started     = false;
     enterOnce   = false;
     active      = false;
     anim        = GetComponent <Animator>();
     toolManager = FindObjectOfType <tool_manager>();
 }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        tm             = GameObject.FindObjectOfType <tool_manager> ();
        mr             = GetComponent <MeshRenderer> ();
        inactiveColor  = mr.material;
        guttermesh     = transform.GetComponent <MeshFilter> ().mesh;
        guttercollider = GetComponent <PolygonCollider2D> ();
        Vector3[] v = guttermesh.vertices;
        gutterwidth = v [2].x - v [0].x;
        float min = transform.InverseTransformPoint(minPos.position).x;
        float max = transform.InverseTransformPoint(maxPos.position).x;

        gutterrange = new Vector2(min, max);
        snapPos     = new Vector3[snapTransforms.Length];
        for (int i = 0; i < snapPos.Length; i++)
        {
            snapPos [i] = transform.InverseTransformPoint(snapTransforms [i].position);
        }
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     tm  = GameObject.FindObjectOfType <tool_manager> ();
     col = GetComponent <BoxCollider2D> ();
     triggerTargets(false);
 }