コード例 #1
0
    public void Init(Guid id, Connection newConnection)
    {
        connectionID = id;
        myConnection = newConnection;

        Debug.Log("CONNECTION: Initialized connection!");

        //originPole_handler = world.GameObjectFromTileXCoord(Mathf.RoundToInt(transform.parent.position.x)).GetComponent<Pole_Handler>();
        originPole_handler = connection_manager.GetPoleHandler(Mathf.RoundToInt(transform.parent.position.x));

        if (originPole_handler == null)
        {
            Debug.LogError("New Connection could not find it's origin pole from the Connection Manager! Was it not set? Is the X coordinate incorrect?");
        }

        // As soon as the connection has been initialized, it can start Transferring Data ONLY if it's an INPUT connection
        if (newConnection.connectionMode == ConnectionMode.INPUT)
        {
            StartCoroutine("TransferData");
        }
    }
コード例 #2
0
 public void AddNewPoleHandler(int x, Pole_Handler poleHandler)
 {
     pole_handlers.Add(x, poleHandler);
 }