Пример #1
0
    void Start()
    {
        trans     = GetComponent <Transform> ();
        render    = GetComponent <SpriteRenderer> ();
        scpSheep2 = GetComponent <Sheep2> ();
        //scpSheep3     = GetComponent<Sheep3> ();

        scpSheep3_2 = goSheep3.GetComponent <Sheep3> ();
        Debug.Log(trans);
        Debug.Log(render);
        Debug.Log(scpSheep2);
        Debug.Log(scpSheep3 + ":" + scpSheep3_2);
        Debug.Log(scpSheep3 == scpSheep3_2);

        //value
        Vector3 _v1, _v2;

        _v1 = new Vector3(1f, 2f, 3f);
        _v2 = _v1;
        Debug.Log(_v1 + ":" + _v2);
        _v1.x = 11f;
        Debug.Log(_v1 + ":" + _v2);

        //reference
        //scpSheep3
        //scpSheep3_2
        scpSheep3.InvokeDisplay(1);
        scpSheep3_2.InvokeDisplay(2);

        scpSheep3.x1   = 99f;
        scpSheep3_2.v1 = new Vector3(77, 777, 7777);

        scpSheep3.InvokeDisplay(11);
        scpSheep3_2.InvokeDisplay(12);
    }