コード例 #1
0
	public void AddStringEvent( string evtString )
	{
		EventData e = OmicronConnectorClient.StringToEventData(evtString);
		if(!getReal3D.Cluster.isMaster)
		{
			AddEvent(e);
		}
	}
コード例 #2
0
    // Initializations
    public void Awake()
    {
        omicronManagerInstance = this;
        omicronListener = new EventListener(this);
        omicronManager = new OmicronConnectorClient(omicronListener);

        eventList = new ArrayList();
    }
コード例 #3
0
	// Initializations
	public void Start()
	{
		omicronListener = new EventListener(this);
		omicronManager = new OmicronConnectorClient(omicronListener);
		
		if( connectToServer )
		{
			omicronManager.Connect( serverIP, serverMsgPort, dataPort );
		}
		
		eventList = new ArrayList();
	}// start
コード例 #4
0
	// Initializations
	public void Start()
	{
		omicronListener = new EventListener(this);
		omicronManager = new OmicronConnectorClient(omicronListener);
		
		eventList = new ArrayList();
		
		if( connectToServer && CAVE2Manager.IsMaster() )
		{
			ConnectToServer();
		}
	}// start
コード例 #5
0
	public void Update()
	{
		if( mouseTouchEmulation )
			{
				Vector2 position = new Vector3( Input.mousePosition.x, Input.mousePosition.y );
						
				// Ray extending from main camera into screen from touch point
				Ray touchRay = Camera.main.ScreenPointToRay(position);
				Debug.DrawRay(touchRay.origin, touchRay.direction * 10, Color.white);
						
				TouchPoint touch = new TouchPoint(position, -1);
				
				if( Input.GetMouseButtonDown(0) )
					touch.SetGesture( EventBase.Type.Down );
				else if( Input.GetMouseButtonUp(0) )
					touch.SetGesture( EventBase.Type.Up );
				else if( Input.GetMouseButton(0) )
					touch.SetGesture( EventBase.Type.Move );
				
				//GameObject[] touchObjects = GameObject.FindGameObjectsWithTag("OmicronListener");
				//foreach (GameObject touchObj in touchObjects) {
				//	touchObj.BroadcastMessage("OnTouch",touch,SendMessageOptions.DontRequireReceiver);
				//}
			}
			
			lock(eventList.SyncRoot)
			{
				foreach( EventData e in eventList )
				{
					ArrayList activeClients = new ArrayList();
					foreach( OmicronEventClient c in omicronClients )
					{
						if( !c.IsFlaggedForRemoval() )
						{
							c.BroadcastMessage("OnEvent",e,SendMessageOptions.DontRequireReceiver);
							activeClients.Add(c);
						}
					}
					omicronClients = activeClients;
					
					#if USING_GETREAL3D
					if(getReal3D.Cluster.isMaster)
					{
						getReal3D.RpcManager.call ("AddStringEvent", OmicronConnectorClient.EventDataToString(e));
					}
					#endif
				}
				
				// Clear the list (TODO: probably should set the Processed flag instead and cleanup elsewhere)
				eventList.Clear();
			}
	}
コード例 #6
0
    // Initializations
    public void Start()
	{
        omicronManagerInstance = this;
        omicronListener = new EventListener(this);
		omicronManager = new OmicronConnectorClient(omicronListener);
		
		eventList = new ArrayList();

        if (connectToServer)
        {
            StartCoroutine("ConnectToServer");
        }

        DontDestroyOnLoad(gameObject);
    }// start