示例#1
1
	void Start () {
		player = GameObject.FindGameObjectWithTag ("Player").GetComponent<PlayerMovement> ();
        gun = player.GetComponentInChildren<Gun> ();
        missiles = player.GetComponentInChildren<MissileLauncher> ();
		participants = GameObject.FindGameObjectWithTag ("Participants").GetComponent<ParticipantManager> ();
		targetHold = targetLookDelay;
	}
 public ArrowToTgtRenderer(Camera cam, Color color, Material material) {
     this.cam = cam;
     this.color = color;
     this.material = material;
     participants = GameObject.FindGameObjectWithTag("Participants").GetComponent<ParticipantManager>();
     origin = new Vector3(Screen.width / 2f, Screen.height / 2f, 0);
 }
        public RTPMessageSender(IPEndPoint ep, PresenterModel model, ClassroomModel classroom)
        {
            this.m_Model = model;
            this.m_Classroom = classroom;

            this.m_RtpLocalParticipant = new RtpLocalParticipant(this.m_Model.Participant);

            using(Synchronizer.Lock(this)) {
                // Register the stream event listeners first, since otherwise there would be a chance
                // that streams could be added between creating the RtpSession (which connects immediately).
                this.m_ParticipantManager = new ParticipantManager(this);

                this.m_RtpSession = new RtpSession(ep, this.m_RtpLocalParticipant, true, true);

                // TODO: Choose a meaningful value for the RtpSender name.
                ushort fec;
                short interpacketdelay;
                using (Synchronizer.Lock(model.SyncRoot)) {
                    using (Synchronizer.Lock(model.ViewerState.SyncRoot)) {
                        fec = (ushort)model.ViewerState.ForwardErrorCorrection;
                        interpacketdelay = (short)model.ViewerState.InterPacketDelay;
                    }
                }
                if( fec == 0 )
                    this.m_RtpSender = this.m_RtpSession.CreateRtpSender( "Classroom Presenter", PayloadType.dynamicPresentation, null );
                else
                    this.m_RtpSender = this.m_RtpSession.CreateRtpSenderFec( "Classroom Presenter", PayloadType.dynamicPresentation, null, 0, fec );
                this.m_RtpSender.DelayBetweenPackets = interpacketdelay;

                // Initialize the message chunking utilities.
                this.m_Encoder = new Chunk.ChunkEncoder();
                // TODO: Make the buffer size dynamic, ie., grow if we send a single very large message.
                // Make the buffer store up to 5MB worth of data.
                this.m_FrameBuffer = new FrameBuffer(5 * 1024 * 1024 / this.m_Encoder.MaximumChunkSize);

                // Create the NackManager which is responsible for sending NACKs on behalf of
                // our set of RTPMessageReceivers.
                this.m_NackManager = new RTPNackManager(this, this.m_Classroom);
            }

            // Create network services outside of the "lock(this)" so they can lock their own objects
            // without worrying about locking order.

            // Create the PresenterNetworkService which will watch for changes to the model and send messages.
            this.m_PresenterNetworkService = new PresenterNetworkService(this, this.m_Model);

            // Create the StudentSubmissionsNetworkService which will watch for requests to submit and send messages.
            this.m_StudentSubmissionNetworkService = new StudentSubmissionNetworkService(this, this.m_Model);

            // Create the SynchronizationNetworkService which will watch for all synchronization messages.
            this.m_SynchronizationNetworkService = new SynchronizationNetworkService( this, this.m_Model );

            // Create the ScriptingNetworkService which will watch for all scripting messages.
            this.m_ScriptingNetworkService = new ScriptingNetworkService( this, this.m_Model );

            // Create the BeaconService which will broadcast periodic information about the presentation.
            this.m_BeaconService = new Beacons.DefaultBeaconService(this, this.m_Model);
        }
示例#4
0
	void Start() {
		participants = GameObject.FindGameObjectWithTag("Participants").GetComponent<ParticipantManager>();
		cam = gameObject.GetComponent<Camera> ();

		// Set GUI styles
		style = new GUIStyle();
		lockedStyle = new GUIStyle ();
		allyStyle = new GUIStyle ();
		style.fontSize = lockedStyle.fontSize = allyStyle.fontSize = fontSize;
		style.clipping =  lockedStyle.clipping = allyStyle.clipping = TextClipping.Overflow;

		style.normal.textColor = color;
		lockedStyle.normal.textColor = lockedColor;
		allyStyle.normal.textColor = allyColor;

		InvokeRepeating ("Flicker", flickerDuration, flickerDuration);
		gunCross = new GunCrossRenderer (gunCrossWidth, cam, allyColor);
        arrow = new ArrowToTgtRenderer(cam, allyColor, material);
	}