Ejemplo n.º 1
0
    /* Method to animate a packet from the above layer to this layer
     */
    public void AnimateRequest(int address)
    {
        // Animate a packet going between the two layers

        // Create a new packet object at the location of the above memory layer
        MemoryElementController packet = Instantiate <GameObject>(packetPrefab).GetComponent <MemoryElementController>();

        packet.transform.SetPositionAndRotation(transform.position, transform.rotation);
        packet.Address = address;

        // set the packet source, destination and speed
        packet.sourceLayer        = this;
        packet.destinationLayer   = layerBelow;
        packet.sourcePoint        = GetPositionOfElement(address);
        packet.transform.position = packet.sourcePoint;
        packet.destinationPoint   = layerBelow.GetPositionOfElement(address);
        packet.speed = layerLatency;
    }