示例#1
0
    void OnTriggerStay(Collider other)
    {
        var found = collisions.Find(c => c.collider.GetInstanceID() == other.GetInstanceID());

        if (found == null)
        {
            found = new FloorPiece(other);
            collisions.Add(found);
        }
        found.Frames = MAXIMUM_FLOAT_FRAMES;
    }
示例#2
0
    public void SpawnFloor()
    {
        lastSpawnedObject = pools[0].RemoveFromPool();


        Vector3 pos = transform.position;

        FloorPiece piece = lastSpawnedObject.GetComponent <FloorPiece>();

        piece.pool = pools[0];

        lastSpawnedObject.transform.position = new Vector3(pos.x, -0.51f, pos.z + piece.length);
        lastSpawnedObject.transform.rotation = transform.rotation;
    }
示例#3
0
 void OnTriggerStay(Collider other)
 {
     var found = collisions.Find(c => c.collider.GetInstanceID() == other.GetInstanceID());
     if (found == null)
     {
         found = new FloorPiece(other);
         collisions.Add(found);
     }
     found.Frames = MAXIMUM_FLOAT_FRAMES;
 }
示例#4
0
    private void Move()
    {
        FloorPiece piece = lastSpawnedObject.GetComponent <FloorPiece>();

        transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z + piece.length);
    }