Agent.Start C# (CSharp) Method

Start() private method

private Start ( ) : void
return void
    private void Start()
    {
        // Initialize the rigidbody
        this.rb = GetComponent<Rigidbody> ();
        this.rb.mass = this.mass;
        this.rb.useGravity = false;

        // Initialize the collider
        this.col = GetComponent<Collider> ();

        // Initialize the forward and desired velocity indicators
        this.forwardIndicator = this.transform.FindChild("ForwardParent");
        this.desiredIndicator = this.transform.FindChild("DesiredParent");
    }

Usage Example

Example #1
0
        public void Start(Action<TcpClient, byte[]> onData, Action<TcpClient> onDisconnect)
        {
            TcpListener listener = new TcpListener(port);
            listener.Start();
            running = true;
            AutoResetEvent are = new AutoResetEvent(false);
            agent = new Agent<Action>(
                () => { },
                () => { },
                nextaction =>
                {

                    nextaction();

                    if (running)
                    {
                        return NextAction.WaitForNextMessage;
                    }
                    are.Set();
                    return NextAction.Finish;
                });

            agent.Start();

            agent.SendMessage(() => { StartAccepting(listener, onData, onDisconnect); });
            are.WaitOne();

            listener.Stop();
        }
All Usage Examples Of Agent::Start