コード例 #1
0
    protected void StartAhei(NodeHandle node)
    {
        var network = GetNativeNetwork();

        if (network == null)
        {
            return;
        }

        if (network.nodeGetStatus(node) != NodeStatus.Idle)
        {
            Debug.LogError("Wrong node status");
            return;
        }

        using (var cotaskConstructor = _aheiLibrary.getCotaskConstructor()) {
            _aheiCotask = cotaskConstructor.startTask(network, node);

            if (_aheiCotask == null)
            {
                StopAhei();
                Debug.LogWarning("Failed to start hardware extension interface task on node " + node.value);
                return;
            }

            _aheiNode = node;

            RunAhei();
        }
    }
コード例 #2
0
    protected void StopAhei()
    {
        StopAllCoroutines();

        if (_aheiCotask == null)
        {
            return;
        }

        _aheiCotask.Dispose();
        _aheiCotask = null;
        _aheiNode   = new NodeHandle();
    }
コード例 #3
0
    protected virtual void OnDestroy()
    {
        StopAllCoroutines();

        if (_aheiCotask != null)
        {
            _aheiCotask.Dispose();
            _aheiCotask = null;
        }

        if (_aheiLibrary != null)
        {
            _aheiLibrary.Dispose();
            _aheiLibrary = null;
        }
    }