Esempio n. 1
0
    private void Start()
    {
        intake = intakeObject.GetComponent <IntakeControl>();

        robotCustomizer = m_Robots[m_index].GetComponent <RobotCustomizer>();

        print("Started.....");
        thread = new Thread(startTCPServer);
        thread.Start();
    }
Esempio n. 2
0
    private void Start()
    {
        rb = GetComponent <Rigidbody>();
        robotSoundControl = GetComponent <RobotSoundControl>();

        audioManager = GameObject.Find("ScoreKeeper").GetComponent <AudioManager>();

        previousRealTime = Time.realtimeSinceStartup;
        Console.WriteLine("Started.....");
        receiveThread = new Thread(receiveFromRC);
        receiveThread.Start();

        sendThread = new Thread(sendToRC);
        sendThread.Start();

        shooterControl = shooter.GetComponent <ShooterControl>();
        shooterControl.Commands.Add(() => motorPower6 > 0, shooterControl.shooting);
        shooterControl.Commands.Add(() => motorPower7 >= 0, () =>
        {
            robotSoundControl.playShooterRev(motorPower7);
            shooterControl.setVelocity(motorPower7);
        });

        intakeControl = intake.GetComponent <IntakeControl>();
        intakeControl.Commands.Add(() => motorPower5 != 0, () =>
        {
            robotSoundControl.playIntakeRev(motorPower5);
            intakeControl.setVelocity(motorPower5 * 150);
            intakeControl.deployIntake();
        });
        intakeControl.Commands.Add(() => motorPower5 == 0, () =>
        {
            robotSoundControl.playIntakeRev(motorPower5);
            intakeControl.retractIntake();
        });

        grabberControl = grabber.GetComponent <GrabberControl>();
        grabberControl.Commands.Add(() => motorPower8 > 0, () =>
        {
            grabberControl.startGrab();
        });
        grabberControl.Commands.Add(() => motorPower8 > 0.5, () =>
        {
            grabberControl.lift();
        });
        grabberControl.Commands.Add(() => motorPower8 == 0, () =>
        {
            grabberControl.stopGrab();
        });
    }
Esempio n. 3
0
    private void Start()
    {
        user2 = GameObject.Find("User-2").GetComponent <MultiUserManager>();
        user3 = GameObject.Find("User-3").GetComponent <MultiUserManager>();
        user4 = GameObject.Find("User-4").GetComponent <MultiUserManager>();

        scoreKeeper = GameObject.Find("ScoreKeeper").GetComponent <ScoreKeeper>();
        intake      = GameObject.Find("Intake").GetComponent <IntakeControl>();
        camera      = GameObject.Find("Render Streaming Camera").GetComponent <CameraPosition>();

        robotCustomizer = m_Robots[m_index].GetComponent <RobotCustomizer>();
        gameTimer       = GameObject.Find("ScoreKeeper").GetComponent <GameTimer>();

        currentSpawnPositions = (Transform[])spawnPositions.Clone();
        saveSpawnPositions    = (Transform[])spawnPositions.Clone();
        setSpawn(0);
        resetField("A");

        print("Started.....");
        thread = new Thread(startTCPServer);
        thread.Start();
    }
    void Awake()
    {
        intakeControl = intake.GetComponent <IntakeControl>();

        timer = Time.time;
    }
 void Awake()
 {
     shooterControl = shooter.GetComponent <FtcShooterControl>();
     intakeControl  = intake.GetComponent <IntakeControl>();
 }