Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        AccessorStruct MyAccessorStruct = new AccessorStruct();

        MyAccessorStruct.MyInt = 3;
        Debug.Log(" MyAccessorStruct :" + MyAccessorStruct.MyInt);

        MyAccessorStruct.SetInt(10);
        Debug.Log(" MyAccessorStruct :" + MyAccessorStruct.MyInt);
    }
Exemplo n.º 2
0
        void UseAccessorStruct()
        {
            AccessorStruct accessorStruct = new AccessorStruct();

            accessorStruct.publicInt = 3;
            Debug.Log("accessorStruct.publicInt: " + accessorStruct.publicInt);
            // accessorStruct.publicInt: 3
            accessorStruct.SetInt(7);
            Debug.Log("accessorStruct.GetInt(): " + accessorStruct.GetInt());
            // accessorStruct.GetInt(): 7
        }
Exemplo n.º 3
0
 void Start()
 {
     GetSet gs = new GetSet();
     gs.MyIntEvent += IntChanged;
     gs.MyInt = 10;
     Debug.Log(gs.doubleInt);
     AccessorStruct MyAccessorStruct = new AccessorStruct();
     MyAccessorStruct.MyInt = 3;
     MyAccessorStruct.SetInt(3);
     Debug.Log(MyAccessorStruct.MyInt);
 }
Exemplo n.º 4
0
    void Start()
    {
        GetSet gs = new GetSet();

        gs.MyIntEvent += IntChanged;
        gs.MyInt       = 10;
        Debug.Log(gs.doubleInt);
        AccessorStruct MyAccessorStruct = new AccessorStruct();

        MyAccessorStruct.MyInt = 3;
        MyAccessorStruct.SetInt(3);
        Debug.Log(MyAccessorStruct.MyInt);
    }