Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.E))
        {
            Variable <int[]> a = GameEntry.Pool.DequeueVarObject <Variable <int[]> >();
            a.Value = new int[2] {
                112, 2
            };
            a.Retain();

            GameEntry.Event.CommonEvent.Dispatch(CommonEventId.RegComplete, a);
            a.Release();
            Debug.Log(a.ReferenceCount);
        }

        if (Input.GetKeyDown(KeyCode.H))
        {
            VarInt s = VarInt.Alloc(111);

            GameEntry.Event.CommonEvent.Dispatch(1002, s);
            s.Release();
            Debug.Log(s.ReferenceCount);
        }
    }
    void Start()
    {
        VarInt a = VarInt.Alloc(10);

        StartCoroutine(ReleaseVar(a));
    }